diff options
| author | Christopher J Schaefer <cjschaef@us.ibm.com> | 2016-03-11 15:55:06 -0600 |
|---|---|---|
| committer | Christopher J Schaefer <cjschaef@us.ibm.com> | 2016-04-19 10:35:00 -0500 |
| commit | dbf4f3164655ec69a830ed87db0769f01ac1f720 (patch) | |
| tree | cb93fd0797e8ea00d6faa94f01adddc6bd7083c1 /keystoneclient/base.py | |
| parent | 91d1053f6811d454c538c85ea601dc700a56b4b3 (diff) | |
| download | python-keystoneclient-dbf4f3164655ec69a830ed87db0769f01ac1f720.tar.gz | |
Removing bandit.yaml in favor of defaults
Removing old configuration options for build-in defaults of latest
bandit functionality. Also, marking flagged items with _# nosec_
with a descriptive comment on why the code is acceptable as is.
Co-Authored-By: Christopher J Schaefer <cjschaef@us.ibm.com>
Co-Authored-By: Tom Cocozzello <tjcocozz@us.ibm.com>
Change-Id: I138ebd46a8be195177361a9c3306bb70423b639d
Diffstat (limited to 'keystoneclient/base.py')
| -rw-r--r-- | keystoneclient/base.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/keystoneclient/base.py b/keystoneclient/base.py index 3273ecb..b550ae9 100644 --- a/keystoneclient/base.py +++ b/keystoneclient/base.py @@ -42,7 +42,8 @@ def getid(obj): try: if obj.uuid: return obj.uuid - except AttributeError: + except AttributeError: # nosec(cjschaef): 'obj' doesn't contain attribute + # 'uuid', return attribute 'id' or the 'obj' pass try: return obj.id @@ -131,7 +132,9 @@ class Manager(object): # unlike other services which just return the list... try: data = data['values'] - except (KeyError, TypeError): + except (KeyError, TypeError): # nosec(cjschaef): keystone data values + # not as expected (see comment above), assumption is that values + # are already returned in a list (so simply utilize that list) pass return [obj_class(self, res, loaded=True) for res in data if res] @@ -477,8 +480,8 @@ class Resource(object): try: setattr(self, k, v) self._info[k] = v - except AttributeError: - # In this case we already defined the attribute on the class + except AttributeError: # nosec(cjschaef): we already defined the + # attribute on the class pass def __getattr__(self, k): |
