-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bf4c852 OS-7473. Extracting live_demo.json on pod start d8d9b9b OS-7443. [TS] Cover Greeter component with types 493b160 OS-7450. [TS - KeyValueLabel] Typing improvements and error fixes 2229069 OS-7472. Fixed layout cleaner
- Loading branch information
Showing
13 changed files
with
63 additions
and
65 deletions.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
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
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
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 |
---|---|---|
|
@@ -4,7 +4,6 @@ | |
import logging | ||
import os | ||
import uuid | ||
import tarfile | ||
from collections import defaultdict | ||
from json.decoder import JSONDecodeError | ||
from kombu.pools import producers | ||
|
@@ -45,7 +44,6 @@ | |
DEMO_USER_NAME = 'Demo User' | ||
EMAIL_TEMPLATE = '%[email protected]' | ||
PRESET_FILENAME = 'rest_api/live_demo.json' | ||
PRESET_TAR_XZ = 'rest_api/live_demo.tar.xz' | ||
DUPLICATION_MODULE_NAMES = {'abandoned_instances', 'rightsizing_instances'} | ||
DUPLICATION_COUNT = 3 | ||
TOP_NO_DUPLICATE_RESOURCES = 10 | ||
|
@@ -361,21 +359,13 @@ def _get_basic_params(): | |
return org, name, email, passwd | ||
|
||
@staticmethod | ||
def load_preset(path=None, tar_path=None): | ||
if not os.path.exists(path) and not os.path.exists(tar_path): | ||
raise InternalServerError(Err.OE0452, []) | ||
def load_preset(path=None): | ||
if not os.path.exists(path): | ||
try: | ||
with tarfile.open(tar_path, 'r:xz') as f: | ||
f.extract( | ||
os.path.basename(PRESET_FILENAME), | ||
path=os.path.dirname(PRESET_FILENAME)) | ||
except FileNotFoundError: | ||
raise InternalServerError(Err.OE0452, []) | ||
raise InternalServerError(Err.OE0452, []) | ||
try: | ||
with open(path, 'r') as f: | ||
return json.load(f) | ||
except (JSONDecodeError, FileNotFoundError): | ||
except JSONDecodeError: | ||
raise InternalServerError(Err.OE0450, []) | ||
|
||
def duplicate_resource(self, preset_object, duplication_resource_info_map): | ||
|
@@ -1368,7 +1358,7 @@ def _create(self, pregenerate=False): | |
self.session, self._config, self.token | ||
).get_or_create_profiling_token(organization.id) | ||
|
||
preset = self.load_preset(PRESET_FILENAME, PRESET_TAR_XZ) | ||
preset = self.load_preset(PRESET_FILENAME) | ||
employee_id_to_replace = self.get_replacement_employee(preset) | ||
self.init_duplication_resources(preset) | ||
try: | ||
|
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