summaryrefslogtreecommitdiff
path: root/glanceclient/common/utils.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-04-18 17:04:57 +0000
committerGerrit Code Review <review@openstack.org>2016-04-18 17:04:57 +0000
commit12e92558e50d0aa200d2ca0f98a7110e0adce922 (patch)
treee1a20f59370af9de196a362ac0cee70cf6d209e9 /glanceclient/common/utils.py
parentcad0245885edc63de74b122541bd287d9c74af08 (diff)
parentd0ec3a7ebb6add2e96c4a06231939baf56e2139a (diff)
downloadpython-glanceclient-12e92558e50d0aa200d2ca0f98a7110e0adce922.tar.gz
Merge "Re-enable stacktracing when --debug is used"
Diffstat (limited to 'glanceclient/common/utils.py')
-rw-r--r--glanceclient/common/utils.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/glanceclient/common/utils.py b/glanceclient/common/utils.py
index 7c88ff9..c7dd4dd 100644
--- a/glanceclient/common/utils.py
+++ b/glanceclient/common/utils.py
@@ -467,6 +467,14 @@ def endpoint_version_from_url(endpoint, default_version=None):
return None, default_version
+def debug_enabled(argv):
+ if bool(env('GLANCECLIENT_DEBUG')) is True:
+ return True
+ if '--debug' in argv or '-d' in argv:
+ return True
+ return False
+
+
class IterableWithLength(object):
def __init__(self, iterable, length):
self.iterable = iterable