71
71
"""
72
72
from __future__ import print_function
73
73
74
- VERSION = "v.0.3.612"
75
-
76
74
import sys
77
75
import traceback
78
76
from os .path import basename
103
101
from lib .GetReferences import find_obj_name
104
102
from lib .GetSession import GetSession
105
103
104
+ VERSION = "v.0.3.612"
105
+
106
106
107
107
def enable_environment (dlpx_obj , env_name ):
108
108
"""
@@ -114,7 +114,7 @@ def enable_environment(dlpx_obj, env_name):
114
114
115
115
try :
116
116
environment .enable (dlpx_obj .server_session , env_obj .reference )
117
- print ("Attempting to enable {}" .format (env_name ))
117
+ print ("Attempting to enable {}" .format (env_name ))
118
118
except (DlpxException , RequestError ) as e :
119
119
print_exception (
120
120
"\n ERROR: Enabling the host {} "
@@ -132,7 +132,7 @@ def disable_environment(dlpx_obj, env_name):
132
132
133
133
try :
134
134
environment .disable (dlpx_obj .server_session , env_obj .reference )
135
- print ("Attempting to disable {}" .format (env_name ))
135
+ print ("Attempting to disable {}" .format (env_name ))
136
136
except (DlpxException , RequestError ) as e :
137
137
print_exception (
138
138
"\n ERROR: Disabling the host {} "
@@ -155,7 +155,7 @@ def update_host_address(dlpx_obj, old_host_address, new_host_address):
155
155
try :
156
156
host .update (dlpx_obj .server_session , old_host_obj .reference , host_obj )
157
157
158
- print (
158
+ print (
159
159
"Attempting to update {} to {}" .format (old_host_address , new_host_address )
160
160
)
161
161
@@ -184,27 +184,31 @@ def list_env(dlpx_obj):
184
184
pass
185
185
186
186
if env .type == "WindowsHostEnvironment" :
187
- print (
187
+ print (
188
188
"Environment Name: {}, Username: {}, Host: {},"
189
189
"Enabled: {}, " .format (env .name , env_user , env_host , env .enabled )
190
190
)
191
191
elif env .type == "WindowsCluster" or env .type == "OracleCluster" :
192
- print (
192
+ print (
193
193
"Environment Name: {}, Username: {}"
194
194
"Enabled: {}, " .format (env .name , env_user , env .enabled )
195
195
)
196
196
else :
197
- print ("Environment Name: {}, Username: {}, Host: {}, Enabled: {}," " ASE Environment Params: {}" .format (
198
- env .name ,
199
- env_user ,
200
- env_host ,
201
- env .enabled ,
202
- env .ase_host_environment_parameters
203
- if isinstance (
204
- env .ase_host_environment_parameters , ASEHostEnvironmentParameters
197
+ print (
198
+ "Environment Name: {}, Username: {}, Host: {}, Enabled: {},"
199
+ " ASE Environment Params: {}" .format (
200
+ env .name ,
201
+ env_user ,
202
+ env_host ,
203
+ env .enabled ,
204
+ env .ase_host_environment_parameters
205
+ if isinstance (
206
+ env .ase_host_environment_parameters ,
207
+ ASEHostEnvironmentParameters ,
208
+ )
209
+ else "Undefined" ,
205
210
)
206
- else "Undefined" ,
207
- ))
211
+ )
208
212
209
213
210
214
def delete_env (dlpx_obj , env_name ):
@@ -223,7 +227,7 @@ def delete_env(dlpx_obj, env_name):
223
227
dlpx_obj .jobs [engine_name ] = dlpx_obj .server_session .last_job
224
228
225
229
elif env_obj is None :
226
- print ("Environment was not found in the Engine: {}" .format (env_name ))
230
+ print ("Environment was not found in the Engine: {}" .format (env_name ))
227
231
sys .exit (1 )
228
232
229
233
@@ -385,7 +389,7 @@ def create_linux_env(dlpx_obj, env_name, host_user, ip_addr, toolkit_path, pw=No
385
389
dlpx_obj .jobs [engine_name ] = dlpx_obj .server_session .last_job
386
390
387
391
except (DlpxException , RequestError , HttpError ) as e :
388
- print (
392
+ print (
389
393
"\n ERROR: Encountered an exception while creating the "
390
394
"environment:\n {}" .format (e )
391
395
)
@@ -440,7 +444,7 @@ def create_windows_env(
440
444
if env_obj :
441
445
env_params_obj .host_environment .proxy = env_obj .host
442
446
elif env_obj is None :
443
- print (
447
+ print (
444
448
"Host was not found in the Engine: {}" .format (
445
449
arguments [- - connector_name ]
446
450
)
@@ -452,7 +456,7 @@ def create_windows_env(
452
456
dlpx_obj .jobs [engine_name ] = dlpx_obj .server_session .last_job
453
457
454
458
except (DlpxException , RequestError , HttpError ) as e :
455
- print (
459
+ print (
456
460
"\n ERROR: Encountered an exception while creating the "
457
461
"environment:\n {}" .format (e )
458
462
)
0 commit comments