-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
vultr: fix for unreliable API behavior #45712
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -529,7 +529,6 @@ def _update_auto_backups_setting(self, server, start_server): | |
method="POST", | ||
data=data | ||
) | ||
server = self._wait_for_state(key='server_state', state='ok') | ||
return server | ||
|
||
def _update_ipv6_setting(self, server, start_server): | ||
|
@@ -554,7 +553,6 @@ def _update_ipv6_setting(self, server, start_server): | |
method="POST", | ||
data=data | ||
) | ||
server = self._wait_for_state(key='server_state', state='ok') | ||
server = self._wait_for_state(key='v6_main_ip') | ||
return server | ||
|
||
|
@@ -579,7 +577,6 @@ def _update_private_network_setting(self, server, start_server): | |
method="POST", | ||
data=data | ||
) | ||
server = self._wait_for_state(key='server_state', state='ok') | ||
return server | ||
|
||
def _update_plan_setting(self, server, start_server): | ||
|
@@ -602,7 +599,6 @@ def _update_plan_setting(self, server, start_server): | |
method="POST", | ||
data=data | ||
) | ||
server = self._wait_for_state(key='server_state', state='ok') | ||
return server | ||
|
||
def _handle_power_status_for_update(self, server, start_server): | ||
|
@@ -702,7 +698,7 @@ def _update_server(self, server=None, start_server=True): | |
if self.server_power_state in ['starting', 'running'] and start_server: | ||
server = self.start_server(skip_results=True) | ||
|
||
server = self._wait_for_state(key='server_state', state='ok') | ||
server = self._wait_for_state(key='status', state='active') | ||
return server | ||
|
||
def absent_server(self): | ||
|
@@ -720,7 +716,7 @@ def absent_server(self): | |
method="POST", | ||
data=data | ||
) | ||
for s in range(0, 30): | ||
for s in range(0, 60): | ||
if server is not None: | ||
break | ||
time.sleep(2) | ||
|
@@ -764,7 +760,7 @@ def reinstall_server(self): | |
def _wait_for_state(self, key='power_status', state=None): | ||
time.sleep(1) | ||
server = self.get_server(refresh=True) | ||
for s in range(0, 30): | ||
for s in range(0, 60): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto |
||
# Check for Truely if wanted state is None | ||
if state is None and server.get(key): | ||
break | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit question: Why this change? Is it taking more time to get a server deleted? Also, should this be a parameter, (maybe reuse
api_timeout
) ? Is the behavior observed forserver_state
update also observed here or is it to play safe?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will make it configurable but first, I would like to get this in as a bug fix for 2.7. the timeout was 30 times 2 seconds, I just wanted to make it "engough" long for 2.7 (it seems the time to wait has dramatically increased)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack, shipit'able for me. Do you want to change the
info.get('status')
first?