Skip to content

Commit

Permalink
Added gcloud logging read to API HTTP utility
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 689640996
  • Loading branch information
p3rf Team authored and copybara-github committed Oct 25, 2024
1 parent 8adfb3a commit 065ecd1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions perfkitbenchmarker/providers/gcp/gce_virtual_machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -1289,11 +1289,8 @@ def SimulateMaintenanceEvent(self):

time.sleep(LM_UNAVAILABLE_STATUS_WAIT_TIME_MIN * 60)
stdout, _, retcode = logcmd.Issue(raise_on_failure=False)
if retcode or 'error' in stdout:
raise errors.VirtualMachine.VirtualMachineError(
'Unable to get logs for simulate maintenance event.'
)
elif 'MIGRATION_TEMPORARILY_UNAVAILABLE' in stdout:
# if the migration is temporarily unavailable, retry the migration command
if not retcode and 'MIGRATION_TEMPORARILY_UNAVAILABLE' in stdout:
stdout, _, retcode = cmd.Issue(raise_on_failure=False)
if retcode or 'error' in stdout:
raise errors.VirtualMachine.VirtualMachineError(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def GetDefaultImageProject(self) -> str:

def SetupLMNotification(self):
"""Prepare environment for /scripts/gce_maintenance_notify.py script."""
self.Install('pip')
self.Install('python')
self.RemoteCommand('pip install requests')
self.PushDataFile(
self._LM_NOTICE_SCRIPT, f'{self.temp_dir}\\{self._LM_NOTICE_SCRIPT}'
Expand Down

0 comments on commit 065ecd1

Please sign in to comment.