Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Python linter errors - Part 1 #310

Merged
merged 7 commits into from
Nov 8, 2017

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
@@ -347,7 +347,7 @@ def kill(signal, frame):
def run_push(modules):
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
@@ -384,7 +384,7 @@ def kill(signal, frame):
def run_readme(modules):
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
@@ -787,8 +785,7 @@ def kill(signal, frame):


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
@@ -438,9 +438,9 @@ def update_docker_compose(modules, pipeline):
try:
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
@@ -449,7 +449,7 @@ def load_yml(yml_path):
with open(yml_path) as compose_file:
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