Skip to content

Conversation

@digitalfishpond
Copy link
Contributor

Fixes Python lint errors for #264

@digitalfishpond digitalfishpond changed the title Fix Python linter errors for - Part 1 Fix Python linter errors - Part 1 Oct 30, 2017
kornicameister
kornicameister previously approved these changes Oct 30, 2017
Copy link
Contributor

@kornicameister kornicameister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@timothyb89 you're ok ?

ci.py Outdated
if os.environ.get('TRAVIS_SECURE_ENV_VARS', None) != "true":
print('No push permissions in this context, skipping!')
print('Not pushing: %r' % modules)
print('Not pushing: {0!r}'.format(modules))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need 0 here.

ci.py Outdated
if os.environ.get('TRAVIS_SECURE_ENV_VARS', None) != "true":
print('No Docker Hub permissions in this context, skipping!')
print('Not updating READMEs: %r' % modules)
print('Not updating READMEs: {0!r}'.format(modules))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need 0 here.

ci.py Outdated
def handle_other(files, modules, tags, pipeline):
print('Unsupported event type "%s", nothing to do.' % (
os.environ.get('TRAVIS_EVENT_TYPE')))
print('Unsupported event type "{}", nothing to do.'.format(os.environ.get('TRAVIS_EVENT_TYPE')))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know max length is set to 120 but I would still prefer to stick closer to 80 chars for better diffs on github and shorter lines in editor.

ci.py Outdated
with open(CI_COMPOSE_FILE, 'w') as docker_compose:
yaml.dump(compose_dict, docker_compose, default_flow_style=False)
except:
except (RuntimeError, IOError):
Copy link
Member

@matrixik matrixik Nov 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use EnvironmentError instead of IOError
https://docs.python.org/2/library/exceptions.html#exceptions.EnvironmentError
and catch also error from yaml

ci.py Outdated
compose_dict = yaml.safe_load(compose_file)
return compose_dict
except:
except(RuntimeError, IOError):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use EnvironmentError instead of IOError
https://docs.python.org/2/library/exceptions.html#exceptions.EnvironmentError
and catch also error from yaml

@matrixik matrixik merged commit fd5460f into monasca:master Nov 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants