git.annexia.org
/
mclu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rewrite to use ansible.
[mclu.git]
/
mclu_build.py
diff --git
a/mclu_build.py
b/mclu_build.py
index
5ae8bae
..
929f45a
100644
(file)
--- a/
mclu_build.py
+++ b/
mclu_build.py
@@
-62,26
+62,19
@@
def cmdline (subparsers):
)
p.set_defaults (run=run)
)
p.set_defaults (run=run)
-def run (c, args
, nodes
):
+def run (c, args):
# Did the user request a particular node? If not, we'll run it
# on any node which is up.
m = re.match (r'^(.*):(.*)$', args.name)
if m:
node_name = m.group (1)
vm_name = m.group (2)
# Did the user request a particular node? If not, we'll run it
# on any node which is up.
m = re.match (r'^(.*):(.*)$', args.name)
if m:
node_name = m.group (1)
vm_name = m.group (2)
- if node_name in nodes:
- node = nodes[node_name]
- if not node.ping ():
- sys.exit ("error: requested node (%s) is not up, use mclu wake %s" %
- (node_name, node_name))
- else:
- sys.exit ("error: requested node (%s) does not exist" % node_name)
else:
else:
- node = lib.pick_any_node_which_is_up (
nodes
)
+ node = lib.pick_any_node_which_is_up (
c
)
vm_name = args.name
# Get all the guests, so we can tell if the name is a duplicate.
vm_name = args.name
# Get all the guests, so we can tell if the name is a duplicate.
- running, inactive = lib.get_all_guests (c
, nodes.values ()
)
+ running, inactive = lib.get_all_guests (c)
if vm_name in running or vm_name in inactive:
sys.exit ("error: node name (%s) already exists" % vm_name)
if vm_name in running or vm_name in inactive:
sys.exit ("error: node name (%s) already exists" % vm_name)
@@
-118,5
+111,5
@@
def run (c, args, nodes):
fp.close ()
# Start the guest.
fp.close ()
# Start the guest.
- lib.start_guest (c, node, vm_name)
- print "guest built and started on node %s" % node
.
name
+ lib.start_guest (c, node
_name
, vm_name)
+ print "guest built and started on node %s" % node
_
name