0005-agent-common-fix-hobo_notify-8425.patch
hobo/agent/common/management/commands/hobo_notify.py | ||
---|---|---|
75 | 75 |
assert cls.check_valid_role(o) |
76 | 76 |
uuids.add(o['uuid']) |
77 | 77 |
if action == 'provision': |
78 |
role, created = Role.objects.create( |
|
78 |
role, created = Role.objects.get_or_create(
|
|
79 | 79 |
uuid=o['uuid'], defaults={ |
80 | 80 |
'name': o['name'], |
81 | 81 |
'description': o['description']}) |
... | ... | |
93 | 93 |
for role in Role.objects.exclude(uuid__in=uuids): |
94 | 94 |
role.delete() |
95 | 95 |
elif action == 'deprovision': |
96 |
for role in Role.objects.filter(uuid_in=uuids): |
|
96 |
for role in Role.objects.filter(uuid__in=uuids):
|
|
97 | 97 |
role.delete() |
98 |
- |