2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-22 09:32:21 +00:00

Rename nodes and groups collections

It has been expressed that plural form for collection names are preferred.  Additionally, tab
completion is nicer if names do not share so much leading characters.
This commit is contained in:
Jarrod Johnson 2014-03-28 14:59:37 -04:00
parent e96e4bd527
commit f7321f4e70
4 changed files with 9 additions and 9 deletions

View File

@ -368,7 +368,7 @@ inconsole = False
pendingcommand = ""
if len(args) == 1: # a node name, go straight to trying to console
consoleonly = True
do_command("start /node/%s/console/session" % args[0], server)
do_command("start /nodes/%s/console/session" % args[0], server)
while not doexit:
if inconsole:
rdylist, _, _ = select.select((sys.stdin, session.connection), (), (), 60)

View File

@ -38,7 +38,7 @@ class _ConsoleHandler(object):
def _connect(self):
self._console = plugin.handle_path(
"/node/%s/_console/session" % self.node,
"/nodes/%s/_console/session" % self.node,
"create", self.cfgmgr)
self._console.connect(self.get_console_output)

View File

@ -71,8 +71,8 @@ def node_creation_resources():
desc=attribs.node[attr]['description']).html() + '<br>\n'
create_resource_functions = {
'/node/': node_creation_resources,
'/nodegroup/': group_creation_resources,
'/nodes/': node_creation_resources,
'/groups/': group_creation_resources,
}
@ -356,7 +356,7 @@ def _assemble_html(responses, resource, querydict, url):
firstpass = True
for y in create_resource_functions[url]():
if firstpass:
yield "<hr>Define new %s:<BR>" % url.split("/")[-2]
yield "<hr>Define new resource in %s:<BR>" % url.split("/")[-2]
firstpass = False
yield y
yield ('<input value="create" name="restexplorerop" type="submit">'

View File

@ -58,7 +58,7 @@ def load_plugins():
pluginmap[plugin] = tmpmod
rootcollections = ['node/', 'nodegroup/']
rootcollections = ['nodes/', 'groups/']
class PluginRoute(object):
@ -151,7 +151,7 @@ def enumerate_nodegroup_collection(collectionpath, configmanager):
return iterate_resources(collection)
def enumerate_node_collection(collectionpath, configmanager):
if collectionpath == ['node']: # it is just '/node/', need a list of nodes
if collectionpath == ['nodes']: # it is just '/node/', need a list of nodes
return iterate_collections(configmanager.get_nodes())
node = collectionpath[1]
if not configmanager.is_node(node):
@ -203,7 +203,7 @@ def handle_path(path, operation, configmanager, inputdata=None):
del pathcomponents[-1]
if not pathcomponents: # root collection list
return enumerate_collections(rootcollections)
elif pathcomponents[0] == 'nodegroup':
elif pathcomponents[0] == 'groups':
try:
group = pathcomponents[1]
except IndexError:
@ -229,7 +229,7 @@ def handle_path(path, operation, configmanager, inputdata=None):
nodes=None, element=pathcomponents,
configmanager=configmanager,
inputdata=inputdata)
elif pathcomponents[0] in ('node', 'system', 'vm'):
elif pathcomponents[0] in ('nodes', 'system', 'vm'):
#single node request of some sort
try:
node = pathcomponents[1]