diff --git a/pypx/pfstorage.py b/pypx/pfstorage.py index 980d009..52a0765 100755 --- a/pypx/pfstorage.py +++ b/pypx/pfstorage.py @@ -58,8 +58,8 @@ def __init__(self, arg, *args, **kwargs): """ proto = 'https' if arg['str_swiftPort'] == '443' else 'http' - if arg['str_swiftBaseLocation']: - cont_name = arg['str_swiftBaseLocation'] + if arg['str_storeBaseLocation']: + cont_name = arg['str_storeBaseLocation'] else: cont_name = "users" self.state_create( @@ -1062,4 +1062,4 @@ def run(self, opt={}) -> dict: self.log(str_msg, comms = 'error') self.log(json.dumps(d_actionResult, indent = 4), comms = 'tx') - return d_actionResult \ No newline at end of file + return d_actionResult diff --git a/pypx/push.py b/pypx/push.py index 7a882e5..b691906 100644 --- a/pypx/push.py +++ b/pypx/push.py @@ -120,9 +120,9 @@ def parser_setup(str_desc): action = 'store_true', default = False) parser.add_argument( - '--swiftBaseLocation', + '--storeBaseLocation', action = 'store', - dest = 'str_swiftBaseLocation', + dest = 'str_storeBaseLocation', type = str, default = '', help = 'swift base location to push files') @@ -244,15 +244,15 @@ def serviceKey_process(self) -> dict: d_swiftInfo : dict = {} d_swiftInfo['status'] = False if len(self.arg['swift']): - d_swiftInfo = self.smdb.service_keyAccess('swift') + d_swiftInfo = self.smdb.service_keyAccess('storage') if d_swiftInfo['status']: - storageType = d_swiftInfo['swift'][self.arg['swift']]['storagetype'] + storageType = d_swiftInfo['storage'][self.arg['swift']]['storagetype'] if storageType == "swift": - self.arg['str_swiftIP'] = d_swiftInfo['swift'][self.arg['swift']]['ip'] - self.arg['str_swiftPort'] = d_swiftInfo['swift'][self.arg['swift']]['port'] - self.arg['str_swiftLogin'] = d_swiftInfo['swift'][self.arg['swift']]['login'] + self.arg['str_swiftIP'] = d_swiftInfo['storage'][self.arg['swift']]['ip'] + self.arg['str_swiftPort'] = d_swiftInfo['storage'][self.arg['swift']]['port'] + self.arg['str_swiftLogin'] = d_swiftInfo['storage'][self.arg['swift']]['login'] elif storageType == "fs": - self.arg['str_swiftBaseLocation'] = d_swiftInfo['swift'][self.arg['swift']]['storepath'] + self.arg['str_storeBaseLocation'] = d_swiftInfo['storage'][self.arg['swift']]['storepath'] return d_swiftInfo def __init__(self, arg): @@ -332,7 +332,7 @@ def path_pushToSwift(self): 'mapLocationOver' : self.arg['str_xcrdir'] } } - if self.arg['str_swiftBaseLocation']: + if self.arg['str_storeBaseLocation']: store = fileStorage(self.arg) else: store = swiftStorage(self.arg) @@ -349,7 +349,7 @@ def path_pushToSwift(self): self.smdb.seriesData('push', 'timestamp', now.strftime("%Y-%m-%d, %H:%M:%S")) if len(self.arg['swift']): self.smdb.seriesData('push', 'swift', - self.smdb.service_keyAccess('swift')['swift'][self.arg['swift']]) + self.smdb.service_keyAccess('storage')['storage'][self.arg['swift']]) return d_storeDo def run(self, opt={}) -> dict: diff --git a/pypx/smdb.py b/pypx/smdb.py index af069d6..20733ba 100644 --- a/pypx/smdb.py +++ b/pypx/smdb.py @@ -432,7 +432,7 @@ def __init__(self, args): '../' ) self.str_services : str = "services" - self.str_swiftService : str = "swift.json" + self.str_swiftService : str = "storage.json" self.str_CUBEservice : str = "cube.json" self.str_PACSservice : str = "pacs.json" self.str_TELEservice : str = "telemetry.json" @@ -1669,7 +1669,7 @@ def service_keyAccess(self, astr_service) -> dict: d_update : dict = {} d_ret['status'] = False - if astr_service.lower().strip() == 'swift': + if astr_service.lower().strip() == 'storage': str_service : str = os.path.join( self.str_servicesDir, self.str_swiftService @@ -1800,8 +1800,8 @@ def DBtablesGet_do() -> dict: d_run = seriesDirLocation_doget() if 'DBtablesGet' in self.args.str_action: d_run = DBtablesGet_do() - if 'swift' in self.args.str_action: - d_run = self.service_keyAccess('swift') + if 'storage' in self.args.str_action: + d_run = self.service_keyAccess('storage') if 'CUBE' in self.args.str_action: d_run = self.service_keyAccess('CUBE') if 'PACS' in self.args.str_action: diff --git a/workflow.sh b/workflow.sh index b3ea02d..01d1d4a 100644 --- a/workflow.sh +++ b/workflow.sh @@ -42,7 +42,7 @@ PURPOSE=" # Which pypx do you want to use? :) # export PYPX=fnndsc/pypx -export PYPX=fnndsc/pypx +export PYPX=local/pypx # # Manually run a storescp: @@ -52,11 +52,11 @@ export PYPX=fnndsc/pypx # # MOST LIKELY YOU WILL NOT NEED TO DO THIS # -storescp -od /tmp/data \ - -pm -sp \ - -xcr "/home/rudolphpienaar/src/pypx/bin/px-repack --xcrdir #p --xcrfile #f --verbosity 0 --logdir /home/dicom/log --datadir /home/dicom/data" \ - -xcs "/home/rudolphpienaar/src/pypx/bin/px-smdb --xcrdir #p --action endOfStudy" \ - 11113 +#storescp -od /tmp/data \ +# -pm -sp \ +# -xcr "/home/rudolphpienaar/src/pypx/bin/px-repack --xcrdir #p --xcrfile #f --verbosity 0 --logdir /home/dicom/log --datadir /home/dicom/data" \ +# -xcs "/home/rudolphpienaar/src/pypx/bin/px-smdb --xcrdir #p --action endOfStudy" \ +# 11113 # Edit any/all of the following as appropriate to your local env. @@ -64,7 +64,7 @@ storescp -od /tmp/data \ # swift storage environment # export SWIFTKEY=local -export SWIFTHOST=10.0.0.230 +export SWIFTHOST=192.168.0.9 export SWIFTPORT=8080 export SWIFTLOGIN=chris:chris1234 export SWIFTSERVICEPACS=orthanc @@ -73,7 +73,7 @@ export SWIFTSERVICEPACS=orthanc # CUBE login details # export CUBEKEY=local -export CUBEURL=http://localhost:8000/api/v1/ +export CUBEURL=http://192.168.0.9:8000/api/v1/ export CUBEusername=chris export CUBEuserpasswd=chris1234 @@ -91,7 +91,7 @@ export DB=/neuro/users/chris/PACS/log # export AEC=ORTHANC export AET=CHRISLOCAL -export PACSIP=192.168.1.200 +export PACSIP=192.168.0.9 export PACSPORT=4242 #