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

Catch self update apierror #238

Merged
merged 4 commits into from
Feb 23, 2019
Merged

Catch self update apierror #238

merged 4 commits into from
Feb 23, 2019

Conversation

circa10a
Copy link
Member

address #230

@circa10a
Copy link
Member Author

fixing lint now
just catching

  me_created = self.client.api.create_container(**new_config)
  new_me = self.client.containers.get(me_created.get("Id"))
  new_me.start()

@dirtycajunrice
Copy link
Member

looks like you need to fix the lint errors. Also do you want to catch the whole thing or just the create?

@dirtycajunrice
Copy link
Member

you have to catch the create not the start. it cant create a container with a name that exists

@circa10a
Copy link
Member Author

circa10a commented Feb 23, 2019

try:
      me_created = self.client.api.create_container(**new_config)  <== catching create?
      new_me = self.client.containers.get(me_created.get("Id"))
      new_me.start()
      self.logger.debug('If you strike me down, I shall become \
                                   more powerful than you could possibly imagine.')
      self.logger.debug('https://bit.ly/2VVY7GH')
      sleep(30)
except APIError as e:
      self.logger.error("Self update failed.")
      self.logger.error(e)

Copy link
Member

@dirtycajunrice dirtycajunrice left a comment

Choose a reason for hiding this comment

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

🙌

@circa10a circa10a merged commit 0d54908 into develop Feb 23, 2019
@dirtycajunrice dirtycajunrice deleted the catch_self_update_apierror branch February 25, 2019 16:08
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