Skip to content

Commit

Permalink
patch for issues/22.
Browse files Browse the repository at this point in the history
  • Loading branch information
halleysouza committed Sep 18, 2023
1 parent 2483bbb commit 00bb4eb
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions gce_rescue/gce.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
# limitations under the License.

""" Initilization Instance() with VM information. """
import sys

from googleapiclient.discovery import Resource
from googleapiclient.errors import HttpError

from dataclasses import dataclass, field
from typing import Dict, List, Union
Expand Down Expand Up @@ -42,7 +44,6 @@ def get_instance_info(
**project_data,
instance = name).execute()


def guess_guest(data: Dict) -> str:
"""Determined which Guest OS Family is being used and select a
different OS for recovery disk.
Expand Down Expand Up @@ -113,12 +114,16 @@ def __post_init__(self):
test_mode=self.test_mode,
**self.project_data
)
self.compute = check.compute
self.project = check.adc_project
self.data = get_instance_info(
try:
self.compute = check.compute
self.project = check.adc_project
self.data = get_instance_info(
compute=self.compute,
name=self.name,
project_data=self.project_data)
except HttpError as e:
print(e.reason)
sys.exit(1)

self._rescue_mode_status = validate_instance_mode(self.data)
self.ts = self._rescue_mode_status['ts']
Expand Down

0 comments on commit 00bb4eb

Please sign in to comment.