Skip to content

Commit

Permalink
Fix imports failing unittest
Browse files Browse the repository at this point in the history
Fix imports failing unittest
Refactor get_storage_client -> get_storage_manager
  • Loading branch information
ayeleta committed Mar 31, 2017
1 parent 809cc57 commit 8246132
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import RepositoryClient
from RepositoryClient import *
from sandbox_scripts.QualiEnvironmentUtils.Sandbox import *
import base64
try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import ftplib
import tempfile

import StorageClient
from StorageClient import *
from sandbox_scripts.QualiEnvironmentUtils.Sandbox import *


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# coding=utf-8
import subprocess
import StorageClient
from StorageClient import *
from sandbox_scripts.QualiEnvironmentUtils.Sandbox import *

try:
Expand All @@ -14,9 +14,10 @@ class TFTPClient(StorageClient):
# ----------------------------------
# ----------------------------------
def __init__(self, sandbox, storage_resource):
super(TFTPClient,self).__init__(sandbox, storage_resource)
if imported_tftpy == False:
self.sandbox.report_error('TFTPY lib was not installed', write_to_output_window=True)
super(TFTPClient,self).__init__(sandbox, storage_resource)

self.username = storage_resource.get_attribute("Storage username")
self.password = storage_resource.get_attribute("Storage password")
self.tftp_psexe = storage_resource.get_attribute('TFTP psexec')
Expand Down
2 changes: 1 addition & 1 deletion sandbox_scripts/environment/setup/setup_VM.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def execute(self):

#TODO: don't use networking save and restore to figure if it's a snapshot setup
saveNRestoreTool = NetworkingSaveRestore(self.sandbox)
if saveNRestoreTool.get_storage_client():
if saveNRestoreTool.get_storage_manager():
if saveNRestoreTool.is_snapshot():
self.is_snapshot = True

Expand Down
2 changes: 1 addition & 1 deletion sandbox_scripts/environment/setup/setup_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def execute(self):
pass
ignore_models=['Generic TFTP server', 'Config Set Pool','Generic FTP server','netscout switch 3912']

if saveNRestoreTool.get_storage_client():
if saveNRestoreTool.get_storage_manager():
if saveNRestoreTool.is_snapshot():
saveNRestoreTool.load_config(config_stage='Snapshots', config_type='Running',
ignore_models=ignore_models)
Expand Down
2 changes: 1 addition & 1 deletion sandbox_scripts/environment/teardown/teardown_VM.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def execute(self):
is_snapshot = False

#if the current reservation was saved as snapshot we look it by reservation_id
if saveNRestoreTool.get_storage_client():
if saveNRestoreTool.get_storage_manager():
if saveNRestoreTool.is_snapshot(filename):
is_snapshot = True
saveNRestoreTool.delete_src_file(filename)
Expand Down
2 changes: 1 addition & 1 deletion sandbox_scripts/environment/teardown/teardown_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def execute(self):
sandbox.report_info("Beginning load configuration for resources")
sandbox.clear_all_resources_live_status()
try:
if saveNRestoreTool.get_storage_client():
if saveNRestoreTool.get_storage_manager():
ignore_models = ['Generic TFTP server', 'Config Set Pool', 'Generic FTP server', 'netscout switch 3912',
'OnPATH Switch 3903', 'Ixia Traffic generator']
saveNRestoreTool.load_config(config_stage='Base', config_type='Running',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ def is_resources_in_reservation_to_restore(self,ignore_models):

# ----------------------------------
# ----------------------------------
def get_storage_client(self):
def get_storage_manager(self):
return self.storage_mgr

class image_struct:
Expand Down

0 comments on commit 8246132

Please sign in to comment.