Browse Source

Merge pull request #4109 from ewolinetz/fix_ocobj_absent

Merged by openshift-bot
OpenShift Bot 8 years ago
parent
commit
3a8f805e13
2 changed files with 2 additions and 2 deletions
  1. 1 1
      roles/lib_openshift/library/oc_obj.py
  2. 1 1
      roles/lib_openshift/src/class/oc_obj.py

+ 1 - 1
roles/lib_openshift/library/oc_obj.py

@@ -1548,7 +1548,7 @@ class OCObject(OpenShiftCLI):
         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:

+ 1 - 1
roles/lib_openshift/src/class/oc_obj.py

@@ -117,7 +117,7 @@ class OCObject(OpenShiftCLI):
         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: