diff options
authorSam Thursfield <>2016-02-19 12:08:44 (GMT)
committerSam Thursfield <>2016-02-19 12:11:29 (GMT)
commitc03b9c714e38b24c1b09ec4ab4da8f8b593b1c47 (patch)
parent535443bcfa78568ecdd091a57e4aff64bfbf9638 (diff)
deploy: Fix an unlikely crash at deploy-time
For some reason I had a deployment .morph file that specified: deploy-defaults: This resulted in the deploy_defaults variable having value None, which lead to a crash further down: 2016-02-19 12:03:52 Deciding on task order Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/cliapp/", line 190, in _run self.process_args(args) File "/src/morph/morphlib/", line 299, in process_args cliapp.Application.process_args(self, args) File "/usr/lib/python2.7/site-packages/cliapp/", line 539, in process_args method(args[1:]) File "/src/morph/morphlib/plugins/", line 574, in upgrade self.deploy(args) File "/src/morph/morphlib/plugins/", line 370, in deploy env_vars, deployments) File "/src/morph/morphlib/plugins/", line 403, in deploy_cluster parent_location='') File "/src/morph/morphlib/plugins/", line 462, in deploy_system env_vars, deployment_filter, parent_location) File "/src/morph/morphlib/plugins/", line 483, in deploy_system_with_source_pool system_id, env_vars, deploy_defaults, deploy_params) File "/src/morph/morphlib/plugins/", line 59, in configuration_for_system deploy_params.items() + AttributeError: 'NoneType' object has no attribute 'items' This change makes the code work as expected. Change-Id: I667f4142667be31797cac7c8994d35a404119cca
1 files changed, 2 insertions, 2 deletions
diff --git a/morphlib/plugins/ b/morphlib/plugins/
index 189222a..18ea8d8 100644
--- a/morphlib/plugins/
+++ b/morphlib/plugins/
@@ -1,4 +1,4 @@
-# Copyright (C) 2013-2015 Codethink Limited
+# Copyright (C) 2013-2016 Codethink Limited
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -471,7 +471,7 @@ class DeployPlugin(cliapp.Plugin):
build_command = morphlib.buildcommand.BuildCommand(
artifact = build_command.resolve_artifacts(source_pool)
- deploy_defaults = system.get('deploy-defaults', {})
+ deploy_defaults = system.get('deploy-defaults') or {}
for system_id, deploy_params in system['deploy'].iteritems():
if not system_id in deployment_filter and deployment_filter: