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

Added flag to skip sending a registration request and minor fixes #243

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

silverdrake11
Copy link
Contributor

When in interactive mode, the user is prompted if a registration message needs to be sent. However in silent mode, no such option exists, and one is always sent. This MR adds a flag to skip the registration request. This has uses such as interacting with WSL and also the client charm.

In addition some minor fixes were made:

  • Remove http:// and slashes from landscape domain if user accidentally provides it
  • Removed depreciated iteritems to prevent warning in tests
  • Closed opened file handles in tests to prevent warning

Copy link
Contributor

@wck0 wck0 left a comment

Choose a reason for hiding this comment

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

Minor nit that probably should be fixed, otherwise LGTM.

Comment on lines +483 to +485
).strip('/')
self.landscape_domain = re.sub(r'^https?://', '',
self.landscape_domain)
Copy link
Contributor

Choose a reason for hiding this comment

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

I notice you are using single quotes instead of double quotes like we have elsewhere in the code. Our linters don't catch this, but it would be good to be consistent.

return open(config.config).read().strip() + "\n"
with open(config.config) as fh:
text = fh.read().strip() + "\n"
return text
Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you for this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants