Skip to content

Commit

Permalink
Fixed Ralph2 sync device subscriber mgmt ip assignment (#2497)
Browse files Browse the repository at this point in the history
Fixed Ralph2 sync device subscriber mgmt ip assignment

* Delete mgmt when ip is empty, otherwise assign it
* Bumped pyhermes version to 0.1.3
  • Loading branch information
mkurek committed Jun 24, 2016
1 parent 52bb3ad commit 9403415
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion requirements/hermes.txt
@@ -1 +1 @@
pyhermes==0.1.2
pyhermes==0.1.3
7 changes: 5 additions & 2 deletions src/ralph/ralph2_sync/subscribers.py
Expand Up @@ -100,8 +100,11 @@ def sync_device_to_ralph3(data):
"""
dca = ImportedObjects.get_object_from_old_pk(DataCenterAsset, data['id'])
dca.hostname = data['hostname']
dca.management_ip = data['management_ip']
dca.management_hostname = data['management_hostname']
if data['management_ip']:
dca.management_ip = data['management_ip']
dca.management_hostname = data['management_hostname']
else:
del dca.management_ip
if data['service'] and data['environment']:
dca.service_env = ServiceEnvironment.objects.get(
service__uid=data['service'],
Expand Down
5 changes: 2 additions & 3 deletions src/ralph/settings/base.py
Expand Up @@ -347,9 +347,8 @@ def os_env_true(var, default=''):


ENABLE_HERMES_INTEGRATION = os_env_true('ENABLE_HERMES_INTEGRATION')
HERMES = {
'ENABLED': ENABLE_HERMES_INTEGRATION
}
HERMES = json.loads(os.environ.get('HERMES', '{}'))
HERMES['ENABLED'] = ENABLE_HERMES_INTEGRATION

if ENABLE_HERMES_INTEGRATION:
INSTALLED_APPS += (
Expand Down

0 comments on commit 9403415

Please sign in to comment.