Projet

Général

Profil

0005-agent-common-fix-hobo_notify-8425.patch

Benjamin Dauvergne, 30 septembre 2015 14:29

Télécharger (1,39 ko)

Voir les différences:

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(-)
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
-