Skip deployed machines during comissionning.
Prod-Related: PROD-34957
Change-Id: Ica59280ec8c71c6b990d720af1e239648eecbe62
diff --git a/_modules/maas.py b/_modules/maas.py
index 41140ea..368507c 100644
--- a/_modules/maas.py
+++ b/_modules/maas.py
@@ -162,6 +162,7 @@
except Exception as e:
LOG.error('Failed for object %s reason %s', name, e)
ret['errors'][name] = str(e)
+
if objects_name is not None:
if ',' in objects_name:
objects_name = objects_name.split(',')
@@ -171,7 +172,11 @@
process_single(object_name, config[object_name])
else:
for name, config_data in config.iteritems():
- process_single(name, config_data)
+ if isinstance(config_data, dict) and 'status_name' in all_elements[name] and all_elements[name]['status_name'] == 'Deployed':
+ LOG.info('Machine %s already deployed, skipping it.' % name)
+ else:
+ process_single(name, config_data)
+
except Exception as e:
LOG.exception('Error Global')
raise
diff --git a/tests/test-requirements.txt b/tests/test-requirements.txt
new file mode 100644
index 0000000..84d12c5
--- /dev/null
+++ b/tests/test-requirements.txt
@@ -0,0 +1,5 @@
+jsonschema
+reno
+setuptools<45.0.0
+msgpack<1.0.0
+