From bb3416d4add4eafa474aaf90295b8503ee9893ab Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Tue, 28 Jul 2015 13:01:30 +0200 Subject: [PATCH] don't crash on delete requests --- osclib/adi_command.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/osclib/adi_command.py b/osclib/adi_command.py index e22d5b4a5..f6babc496 100644 --- a/osclib/adi_command.py +++ b/osclib/adi_command.py @@ -56,10 +56,17 @@ def create_new_adi(self, wanted_requests): # we care only about first action action = action[0] + # Where are we targeting the package - source_project = action.find('source').get('project') if len(wanted_requests): source_project = 'wanted' + else: + source = action.find('source') + if source is not None: + source_project = source.get('project') + else: + source_project = 'none' + target_package = action.find('target').get('package') if not self.api.ring_packages.get(target_package):