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

Misc fixes #236

Merged
merged 7 commits into from
Jan 10, 2018
Merged

Misc fixes #236

merged 7 commits into from
Jan 10, 2018

Conversation

tiran
Copy link
Member

@tiran tiran commented Jan 10, 2018

Fix misc errors detected or caused by most recent versions of pytest, pep8 and pylint.

The new feature is breaking tests.

Signed-off-by: Christian Heimes <cheimes@redhat.com>
Tests are failing under 3.4 because IPA packages no longer support 3.4.

Signed-off-by: Christian Heimes <cheimes@redhat.com>
Issue was found by pylint.

Signed-off-by: Christian Heimes <cheimes@redhat.com>
Signed-off-by: Christian Heimes <cheimes@redhat.com>
@tiran tiran added the bug label Jan 10, 2018
In Python 3, the exception method has the function signature

    def exception(self, msg, *args, exc_info=True, **kwargs):

but Python 2 does not allow that syntax.

Signed-off-by: Christian Heimes <cheimes@redhat.com>
@codecov-io
Copy link

codecov-io commented Jan 10, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@08515e8). Click here to learn what that means.
The diff coverage is 78.26%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #236   +/-   ##
=========================================
  Coverage          ?   72.79%           
=========================================
  Files             ?       41           
  Lines             ?     4440           
  Branches          ?      449           
=========================================
  Hits              ?     3232           
  Misses            ?     1052           
  Partials          ?      156
Impacted Files Coverage Δ
tests/test_secrets.py 98.88% <ø> (ø)
src/custodia/secrets.py 66.66% <ø> (ø)
src/custodia/log.py 78.7% <ø> (ø)
src/custodia/server/__init__.py 18.27% <ø> (ø)
src/custodia/client.py 80.29% <ø> (ø)
src/custodia/httpd/server.py 24.92% <0%> (ø)
tests/test_store.py 100% <100%> (ø)
tests/test_custodia.py 95.03% <100%> (ø)
tests/test_store_sqlite.py 100% <100%> (ø)
src/custodia/plugin.py 68.77% <100%> (ø)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 08515e8...acd2a4e. Read the comment docs.

In Python 3, ConnectionError is also a builtin exception. Import and use
the exceptions package from requests to avoid name collision.

Signed-off-by: Christian Heimes <cheimes@redhat.com>
Signed-off-by: Christian Heimes <cheimes@redhat.com>
Copy link
Member

@simo5 simo5 left a comment

Choose a reason for hiding this comment

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

/lgtm

@@ -55,6 +55,7 @@ def __init__(self, plugin, debug):
extra = {'origin': plugin.origin}
super(CustodiaLoggingAdapter, self).__init__(logger, extra=extra)

# pylint: disable=arguments-differ
def exception(self, msg, *args, **kwargs):
Copy link
Member

@simo5 simo5 Jan 10, 2018

Choose a reason for hiding this comment

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

So what happen when python2 code calls this ?

Copy link
Member Author

Choose a reason for hiding this comment

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

All is fine, it's just cosmetics.

The signature is different in Python 2 than Python 3. pylint is complaining about the difference. We cannot use the Python 3 signature because that is invalid syntax in Python 3. In Python 2, keywords after *args is not supported: exception(self, msg, *args, exc_info=True, **kwargs)

@raildo raildo merged commit f3b6ff5 into latchset:master Jan 10, 2018
@tiran tiran deleted the misc_fixes2 branch January 10, 2018 13:52
@tiran tiran mentioned this pull request Jan 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants