From 1e241fe3447307462f8d4cb9e1f0715155297b57 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Wed, 30 Sep 2015 14:19:41 +0200 Subject: [PATCH 5/5] agent/common: fix hobo_notify (#8425) two trivial bugs found using the new tests --- hobo/agent/common/management/commands/hobo_notify.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hobo/agent/common/management/commands/hobo_notify.py b/hobo/agent/common/management/commands/hobo_notify.py index 3bd5bb2..22e6e00 100644 --- a/hobo/agent/common/management/commands/hobo_notify.py +++ b/hobo/agent/common/management/commands/hobo_notify.py @@ -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() -- 2.1.4