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

Removing deprecated parameter "arch" from "rescue" endpoint #60

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions hetzner/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,21 @@ def _rescue_action(self, method, opts=None):

self._update_status(reply)

def activate(self, bits=64, os='linux', authorized_keys=None):
def activate(self, bits=None, os='linux', authorized_keys=None):
"""
Activate the rescue system if necessary.

Note that 'authorized_keys', if passed, must be a list of fingerprints,
e.g. ['a3:14:62:38:d1:45:35:6c:de:ad:ec:12:be:93:24:ef'] of the keys
that should have been added to robot already.
"""
# Parameter Deprecation Warning - see #59 on GitHub
if bits is not None:
warnings.warn("'bits' parameter is deprecated in Hetzner API; so it is here. See #59 on GitHub.",
category=DeprecationWarning)

if not self.active:
opts = {'os': os, 'arch': bits}
opts = {'os': os}
if authorized_keys is not None:
opts['authorized_key'] = list(authorized_keys)
return self._rescue_action('post', opts)
Expand Down