Skip to content

Commit

Permalink
Merge pull request openshift#4109 from ewolinetz/fix_ocobj_absent
Browse files Browse the repository at this point in the history
Merged by openshift-bot
  • Loading branch information
OpenShift Bot authored May 10, 2017
2 parents e8feac5 + 9bee74c commit 3a8f805
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion roles/lib_openshift/library/oc_obj.py
Original file line number Diff line number Diff line change
Expand Up @@ -1548,7 +1548,7 @@ def run_ansible(params, check_mode=False):
if state == 'absent':
# verify its not in our results
if (params['name'] is not None or params['selector'] is not None) and \
(len(api_rval['results']) == 0 or len(api_rval['results'][0].getattr('items', [])) == 0):
(len(api_rval['results']) == 0 or len(api_rval['results'][0].get('items', [])) == 0):
return {'changed': False, 'state': state}

if check_mode:
Expand Down
2 changes: 1 addition & 1 deletion roles/lib_openshift/src/class/oc_obj.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def run_ansible(params, check_mode=False):
if state == 'absent':
# verify its not in our results
if (params['name'] is not None or params['selector'] is not None) and \
(len(api_rval['results']) == 0 or len(api_rval['results'][0].getattr('items', [])) == 0):
(len(api_rval['results']) == 0 or len(api_rval['results'][0].get('items', [])) == 0):
return {'changed': False, 'state': state}

if check_mode:
Expand Down

0 comments on commit 3a8f805

Please sign in to comment.