Skip to content

Commit

Permalink
don't crash on delete requests
Browse files Browse the repository at this point in the history
  • Loading branch information
coolo committed Jul 28, 2015
1 parent 0166e9d commit bb3416d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion osclib/adi_command.py
Expand Up @@ -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):
Expand Down

0 comments on commit bb3416d

Please sign in to comment.