agent/common: fix hobo_notify (#8425)
two trivial bugs found using the new tests
This commit is contained in:
parent
fd62795a7d
commit
0127af64a7
|
@ -75,7 +75,7 @@ class Command(BaseCommand):
|
|||
assert cls.check_valid_role(o)
|
||||
uuids.add(o['uuid'])
|
||||
if action == 'provision':
|
||||
role, created = Role.objects.create(
|
||||
role, created = Role.objects.get_or_create(
|
||||
uuid=o['uuid'], defaults={
|
||||
'name': o['name'],
|
||||
'description': o['description']})
|
||||
|
@ -93,5 +93,5 @@ class Command(BaseCommand):
|
|||
for role in Role.objects.exclude(uuid__in=uuids):
|
||||
role.delete()
|
||||
elif action == 'deprovision':
|
||||
for role in Role.objects.filter(uuid_in=uuids):
|
||||
for role in Role.objects.filter(uuid__in=uuids):
|
||||
role.delete()
|
||||
|
|
Loading…
Reference in New Issue