Merge lp:~hopem/maas-deployer/lp1491443 into lp:~maas-deployers/maas-deployer/next

Proposed by Edward Hope-Morley
Status: Merged
Merged at revision: 30
Proposed branch: lp:~hopem/maas-deployer/lp1491443
Merge into: lp:~maas-deployers/maas-deployer/next
Diff against target: 90 lines (+19/-7)
4 files modified
maas_deployer/cli.py (+2/-0)
maas_deployer/vmaas/engine.py (+8/-7)
maas_deployer/vmaas/exception.py (+5/-0)
maas_deployer/vmaas/maasclient/driver.py (+4/-0)
To merge this branch: bzr merge lp:~hopem/maas-deployer/lp1491443
Reviewer Review Type Date Requested Status
Ante Karamatić (community) Approve
Review via email: mp+269928@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Ante Karamatić (ivoks) wrote :

Why don't we do a switch 'fail on error', instead of catching every maas call that we should fail on?

Revision history for this message
Edward Hope-Morley (hopem) wrote :

I think we can look into that for the next release. If we implement that kind of logic we have to take a close look at the code to make sure we don't get false positives etc. Basically i think to get that right it will be nontrivial so lets punt it to 0.0.3

Revision history for this message
Ante Karamatić (ivoks) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'maas_deployer/cli.py'
--- maas_deployer/cli.py 2015-08-14 09:16:18 +0000
+++ maas_deployer/cli.py 2015-09-02 14:34:04 +0000
@@ -87,6 +87,8 @@
87 engine = DeploymentEngine(config, target)87 engine = DeploymentEngine(config, target)
88 engine.deploy(target)88 engine.deploy(target)
89 except:89 except:
90 # Remove console handler to avoid displaying the exception twice
91 log.removeHandler(handler)
90 log.exception("MAAS deployment failed.")92 log.exception("MAAS deployment failed.")
91 raise93 raise
92 else:94 else:
9395
=== modified file 'maas_deployer/vmaas/engine.py'
--- maas_deployer/vmaas/engine.py 2015-09-01 23:15:07 +0000
+++ maas_deployer/vmaas/engine.py 2015-09-02 14:34:04 +0000
@@ -14,13 +14,14 @@
1414
15from subprocess import CalledProcessError15from subprocess import CalledProcessError
1616
17
18from maas_deployer.vmaas import (17from maas_deployer.vmaas import (
19 vm,18 vm,
20 util,19 util,
21 template,20 template,
22)21)
2322from maas_deployer.vmaas.exception import (
23 MAASDeployerClientError,
24)
24from maas_deployer.vmaas.maasclient import (25from maas_deployer.vmaas.maasclient import (
25 bootimages,26 bootimages,
26 MAASClient,27 MAASClient,
@@ -417,8 +418,8 @@
417 node_group_interfaces = copy.deepcopy(maas_config['node_group_ifaces'])418 node_group_interfaces = copy.deepcopy(maas_config['node_group_ifaces'])
418 for iface in node_group_interfaces:419 for iface in node_group_interfaces:
419 if not self.create_nodegroup_interface(client, nodegroup, iface):420 if not self.create_nodegroup_interface(client, nodegroup, iface):
420 log.warning("Unable to create nodegroup interface: %s",421 msg = "Unable to create nodegroup interface: %s" % iface
421 iface)422 raise MAASDeployerClientError(msg)
422423
423 nodes = maas_config.get('nodes', [])424 nodes = maas_config.get('nodes', [])
424 self._create_maas_nodes(client, nodes)425 self._create_maas_nodes(client, nodes)
@@ -461,14 +462,14 @@
461 juju_node = self._get_juju_nodename(nodes)462 juju_node = self._get_juju_nodename(nodes)
462 if juju_node is not None and not virsh_info:463 if juju_node is not None and not virsh_info:
463 try:464 try:
464 _, stderr = util.virsh(['start', juju_node])465 util.virsh(['start', juju_node])
465 except CalledProcessError as exc:466 except CalledProcessError as exc:
466 # Ignore already started error467 # Ignore already started error
467 msg = 'Domain is already active'468 msg = 'Domain is already active'
468 if msg not in exc.output:469 if msg not in exc.output:
469 raise470 raise
470 else:471
471 log.debug(msg)472 log.debug(msg)
472473
473 self._wait_for_nodes_to_commission(client)474 self._wait_for_nodes_to_commission(client)
474 self._claim_sticky_ip_address(client, maas_config)475 self._claim_sticky_ip_address(client, maas_config)
475476
=== modified file 'maas_deployer/vmaas/exception.py'
--- maas_deployer/vmaas/exception.py 2015-08-11 22:28:00 +0000
+++ maas_deployer/vmaas/exception.py 2015-09-02 14:34:04 +0000
@@ -30,3 +30,8 @@
30 "running the deployer" % (pool))30 "running the deployer" % (pool))
3131
32 super(MAASDeployerPoolNotFound, self).__init__(msg)32 super(MAASDeployerPoolNotFound, self).__init__(msg)
33
34
35class MAASDeployerClientError(MAASDeployerBaseException):
36 def __init__(self, msg):
37 super(MAASDeployerClientError, self).__init__(msg)
3338
=== modified file 'maas_deployer/vmaas/maasclient/driver.py'
--- maas_deployer/vmaas/maasclient/driver.py 2015-07-23 16:20:28 +0000
+++ maas_deployer/vmaas/maasclient/driver.py 2015-09-02 14:34:04 +0000
@@ -11,6 +11,10 @@
11 self.ok = ok11 self.ok = ok
12 self.data = data12 self.data = data
1313
14 def __nonzero__(self):
15 """Allow boolean comparison"""
16 return bool(self.ok)
17
1418
15class MAASDriver(object):19class MAASDriver(object):
16 """20 """

Subscribers

People subscribed via source and target branches