From: rmccabe@sourceware.org <rmccabe@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] conga/luci homebase/validate_cluster_add_initi ...
Date: 7 Feb 2008 06:13:04 -0000 [thread overview]
Message-ID: <20080207061304.30059.qmail@sourceware.org> (raw)
CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe at sourceware.org 2008-02-07 06:13:04
Modified files:
luci/homebase : validate_cluster_add_initial.js
luci/site/luci/Extensions: LuciZopeAsync.py
Log message:
Authenticate to the initial node during the first step of adding an existing cluster
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/validate_cluster_add_initial.js.diff?cvsroot=cluster&r1=1.6&r2=1.7
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciZopeAsync.py.diff?cvsroot=cluster&r1=1.6&r2=1.7
--- conga/luci/homebase/validate_cluster_add_initial.js 2008/01/23 04:34:09 1.6
+++ conga/luci/homebase/validate_cluster_add_initial.js 2008/02/07 06:13:04 1.7
@@ -32,7 +32,9 @@
if (form.pagetype.value == 7) {
if (confirm('Retrieve cluster information from ' + added_storage[0] + '?')) {
- get_cluster_members();
+ form.pagetype.value = 1000;
+ get_cluster_members(form);
+ form.pagetype.value = 7;
}
} else if (form.pagetype.value == 6) {
if (confirm('Add this cluster?')) {
@@ -62,7 +64,7 @@
return false;
}
-function get_cluster_members() {
+function get_cluster_members(form) {
var url = '/luci/cluster?pagetype=1000';
var node_num = 0;
@@ -73,9 +75,9 @@
}
if (!node_num) {
- alert('No node names were entered');
+ alert('No node hostname was entered');
} else {
- initiate_async_get(url, cluster_member_callback);
+ initiate_async_post(form, url, cluster_member_callback);
}
}
--- conga/luci/site/luci/Extensions/LuciZopeAsync.py 2008/01/22 15:05:17 1.6
+++ conga/luci/site/luci/Extensions/LuciZopeAsync.py 2008/02/07 06:13:04 1.7
@@ -96,13 +96,21 @@
from LuciClusterInfo import getClusterConfNodes
from RicciQueries import getClusterConf
- fvars = GetReqVars(request, [ 'QUERY_STRING' ])
+ fvars = GetReqVars(request, [ 'QUERY_STRING', '__SYSTEM0' ])
if fvars['QUERY_STRING'] is None:
if LUCI_DEBUG_MODE is True:
luci_log.debug_verbose('GCNA0: No query string was given')
write_err_async(request, 'No node names were given')
return None
+ conf_node_pair = fvars['__SYSTEM0']
+ if conf_node_pair is not None and len(conf_node_pair) == 2:
+ conf_node = conf_node_pair[0]
+ conf_node_passwd = conf_node_pair[1]
+ else:
+ conf_node = None
+ conf_node_passwd = None
+
try:
nodes = fvars['QUERY_STRING'].split('&')
node_list = map(lambda x: x[1], filter(lambda x: x[0][:4] == 'node', map(lambda x: x.split('='), nodes)))
@@ -118,7 +126,15 @@
ret = {}
for node_host in node_list:
try:
- rc = RicciCommunicator(node_host)
+ if node_host == conf_node:
+ rc = RicciCommunicator(node_host, enforce_trust=False)
+ rc.trust()
+ rc.auth(conf_node_passwd)
+ if not rc.authed():
+ errors.append('Authentication to node %s failed' % conf_node)
+ break
+ else:
+ rc = RicciCommunicator(node_host)
cluster_name = rc.cluster_info()[0]
if not cluster_name:
errors.append('%s is not a member of a cluster' \
reply other threads:[~2008-02-07 6:13 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080207061304.30059.qmail@sourceware.org \
--to=rmccabe@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).