diff options
| author | Darja Shakhray <dshakhray@mirantis.com> | 2015-07-20 17:29:49 +0300 |
|---|---|---|
| committer | Darja Shakhray <dshakhray@mirantis.com> | 2015-07-21 17:08:27 +0300 |
| commit | ec0f2dfd8500d230895e286462aaf69c43777038 (patch) | |
| tree | d3ef94392fe49f222f07a7e33cb2a371185f95f5 /glanceclient/common/utils.py | |
| parent | d9d586942bf3f78ba174eb5832f60d80a7c839ca (diff) | |
| download | python-glanceclient-ec0f2dfd8500d230895e286462aaf69c43777038.tar.gz | |
Enable flake8 checks
This commit enables new flake8 checks:
* E265 block comment should start with '# '
* H405 multi line docstring summary not separated with an empty line
* E123 closing bracket does not match indentation of opening bracket's line
* H238 old style class declaration, use new style (inherit from `object`)
* E128 continuation line under-indented for visual indent
and makes related changes in the code.
Change-Id: Ie993afc930f6b74d7a990bcaa9fc0e9f5ba1585c
Diffstat (limited to 'glanceclient/common/utils.py')
| -rw-r--r-- | glanceclient/common/utils.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/glanceclient/common/utils.py b/glanceclient/common/utils.py index 7410b3b..18059bb 100644 --- a/glanceclient/common/utils.py +++ b/glanceclient/common/utils.py @@ -215,7 +215,7 @@ def is_authentication_required(f): def env(*vars, **kwargs): - """Search for the first defined of possibly many env vars + """Search for the first defined of possibly many env vars. Returns the first environment variable defined in vars, or returns the default defined in kwargs. @@ -241,8 +241,7 @@ def exit(msg='', exit_code=1): def save_image(data, path): - """ - Save an image to the specified path. + """Save an image to the specified path. :param data: binary data of the image :param path: path to save the image to @@ -276,6 +275,7 @@ def make_size_human_readable(size): def getsockopt(self, *args, **kwargs): """ + A function which allows us to monkey patch eventlet's GreenSocket, adding a required 'getsockopt' method. TODO: (mclaren) we can remove this once the eventlet fix @@ -298,8 +298,7 @@ def exception_to_str(exc): def get_file_size(file_obj): - """ - Analyze file-like object and attempt to determine its size. + """Analyze file-like object and attempt to determine its size. :param file_obj: file-like object. :retval The file's size or None if it cannot be determined. @@ -385,8 +384,7 @@ def print_image(image_obj, human_readable=False, max_col_width=None): def integrity_iter(iter, checksum): - """ - Check image data integrity. + """Check image data integrity. :raises: IOError """ |
