Skip to content

Commit 2f84a42

Browse files
authored
Merge pull request #35 from jtamagnan/master
Improve the CI checks to check every single file in the repository
2 parents c4716ed + db4112f commit 2f84a42

32 files changed

+254
-215
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ jobs:
2424
- name: Install Tox and any other packages
2525
run: pip install tox
2626
- name: Run tox
27-
run: tox
27+
run: tox -- --all-files

delphix_admin_setup.py

+11-10
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
Will come back and properly throw this with logging, etc
66
"""
77
from __future__ import print_function
8-
VERSION = "v.2.3.002"
9-
CONTENTDIR = "/u02/app/content"
108

119
import getopt
1210
import logging
@@ -24,6 +22,9 @@
2422
from delphixpy.v1_6_0.web.vo import PasswordCredential
2523
from delphixpy.v1_6_0.web.vo import User
2624

25+
VERSION = "v.2.3.002"
26+
CONTENTDIR = "/u02/app/content"
27+
2728

2829
def serversess(f_engine_address, f_engine_username, f_engine_password):
2930
"""
@@ -36,25 +37,25 @@ def serversess(f_engine_address, f_engine_username, f_engine_password):
3637

3738

3839
def help():
39-
print (
40+
print(
4041
"\n"
4142
+ basename(__file__)
4243
+ " [-e <engine ip>] [-o <old delphix_admin password] [-p <new delphix_admin password]"
4344
)
44-
print (
45+
print(
4546
"\n\nScript requires three parameters, the IP of the Delphix Engine, the initial delphix_admin password to connect with, and the new delphix_admin password you want to use"
4647
)
47-
print ("-h - Prints this message")
48-
print (
48+
print("-h - Prints this message")
49+
print(
4950
"-e <Delphix Engine IP> - Engine must be up, unconfigured, and console screen must be green"
5051
)
51-
print (
52+
print(
5253
"-o <old delphix_admin password> - will use this password to initially access the system"
5354
)
54-
print (
55+
print(
5556
"-p <new delphix_admin password> - will set the delphix_admin user to this password"
5657
)
57-
print ("-v - Print version information and exit")
58+
print("-v - Print version information and exit")
5859
sys.exit(2)
5960

6061

@@ -126,7 +127,7 @@ def time_elapsed():
126127

127128

128129
def version():
129-
print ("Version: " + VERSION)
130+
print("Version: " + VERSION)
130131
logging_est()
131132
set_exit_handler(on_exit)
132133
sys.exit(1)

dx_authorization.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@
4646
"""
4747
from __future__ import print_function
4848

49-
VERSION = "v.0.0.015"
50-
5149
import sys
5250
import traceback
5351
from os.path import basename
@@ -76,6 +74,8 @@
7674
from lib.GetReferences import find_obj_by_name
7775
from lib.GetSession import GetSession
7876

77+
VERSION = "v.0.0.015"
78+
7979

8080
def create_authorization(dlpx_obj, role_name, target_type, target_name, user_name):
8181
"""
@@ -196,9 +196,11 @@ def list_authorization(dlpx_obj):
196196
elif auth_obj.target.startswith("DOMAIN"):
197197
target_obj = User()
198198
target_obj.name = "DOMAIN"
199-
print("{}, {}, {}, {}".format(
200-
user_obj.name, role_obj.name, target_obj.name, auth_obj.reference
201-
))
199+
print(
200+
"{}, {}, {}, {}".format(
201+
user_obj.name, role_obj.name, target_obj.name, auth_obj.reference
202+
)
203+
)
202204
except (RequestError, HttpError, JobError, AttributeError) as e:
203205
print_exception(
204206
"An error occurred while listing authorizations.:\n" "{}\n".format((e))

dx_delete_vdb.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@
5555
"""
5656
from __future__ import print_function
5757

58-
VERSION = "v.0.0.001"
59-
60-
6158
import json
6259
import logging
6360
import signal
@@ -86,6 +83,8 @@
8683
from delphixpy.v1_6_0.web.vo import ASESpecificBackupSyncParameters
8784
from delphixpy.v1_6_0.web.vo import MSSqlSyncParameters
8885

86+
VERSION = "v.0.0.001"
87+
8988

9089
def find_obj_by_name(engine, server, f_class, obj_name):
9190
"""
@@ -724,7 +723,7 @@ def main(argv):
724723
and not (arguments["--object_type"])
725724
and not (arguments["--all_dbs"])
726725
):
727-
print (__doc__)
726+
print(__doc__)
728727
sys.exit()
729728
# Feed our arguments to the main function, and off we go!
730729
print(arguments)

dx_environment.py

+25-21
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@
7171
"""
7272
from __future__ import print_function
7373

74-
VERSION = "v.0.3.612"
75-
7674
import sys
7775
import traceback
7876
from os.path import basename
@@ -103,6 +101,8 @@
103101
from lib.GetReferences import find_obj_name
104102
from lib.GetSession import GetSession
105103

104+
VERSION = "v.0.3.612"
105+
106106

107107
def enable_environment(dlpx_obj, env_name):
108108
"""
@@ -114,7 +114,7 @@ def enable_environment(dlpx_obj, env_name):
114114

115115
try:
116116
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))
118118
except (DlpxException, RequestError) as e:
119119
print_exception(
120120
"\nERROR: Enabling the host {} "
@@ -132,7 +132,7 @@ def disable_environment(dlpx_obj, env_name):
132132

133133
try:
134134
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))
136136
except (DlpxException, RequestError) as e:
137137
print_exception(
138138
"\nERROR: Disabling the host {} "
@@ -155,7 +155,7 @@ def update_host_address(dlpx_obj, old_host_address, new_host_address):
155155
try:
156156
host.update(dlpx_obj.server_session, old_host_obj.reference, host_obj)
157157

158-
print (
158+
print(
159159
"Attempting to update {} to {}".format(old_host_address, new_host_address)
160160
)
161161

@@ -184,27 +184,31 @@ def list_env(dlpx_obj):
184184
pass
185185

186186
if env.type == "WindowsHostEnvironment":
187-
print (
187+
print(
188188
"Environment Name: {}, Username: {}, Host: {},"
189189
"Enabled: {}, ".format(env.name, env_user, env_host, env.enabled)
190190
)
191191
elif env.type == "WindowsCluster" or env.type == "OracleCluster":
192-
print (
192+
print(
193193
"Environment Name: {}, Username: {}"
194194
"Enabled: {}, ".format(env.name, env_user, env.enabled)
195195
)
196196
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",
205210
)
206-
else "Undefined",
207-
))
211+
)
208212

209213

210214
def delete_env(dlpx_obj, env_name):
@@ -223,7 +227,7 @@ def delete_env(dlpx_obj, env_name):
223227
dlpx_obj.jobs[engine_name] = dlpx_obj.server_session.last_job
224228

225229
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))
227231
sys.exit(1)
228232

229233

@@ -385,7 +389,7 @@ def create_linux_env(dlpx_obj, env_name, host_user, ip_addr, toolkit_path, pw=No
385389
dlpx_obj.jobs[engine_name] = dlpx_obj.server_session.last_job
386390

387391
except (DlpxException, RequestError, HttpError) as e:
388-
print (
392+
print(
389393
"\nERROR: Encountered an exception while creating the "
390394
"environment:\n{}".format(e)
391395
)
@@ -440,7 +444,7 @@ def create_windows_env(
440444
if env_obj:
441445
env_params_obj.host_environment.proxy = env_obj.host
442446
elif env_obj is None:
443-
print (
447+
print(
444448
"Host was not found in the Engine: {}".format(
445449
arguments[--connector_name]
446450
)
@@ -452,7 +456,7 @@ def create_windows_env(
452456
dlpx_obj.jobs[engine_name] = dlpx_obj.server_session.last_job
453457

454458
except (DlpxException, RequestError, HttpError) as e:
455-
print (
459+
print(
456460
"\nERROR: Encountered an exception while creating the "
457461
"environment:\n{}".format(e)
458462
)

dx_groups.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@
4545
"""
4646
from __future__ import print_function
4747

48-
VERSION = "v.0.0.002"
49-
5048
import sys
5149
from os.path import basename
5250
from time import sleep
@@ -69,6 +67,8 @@
6967
from lib.GetReferences import find_obj_by_name
7068
from lib.GetSession import GetSession
7169

70+
VERSION = "v.0.0.002"
71+
7272

7373
def add_group(group_name):
7474
"""
@@ -79,7 +79,7 @@ def add_group(group_name):
7979

8080
try:
8181
group.create(dx_session_obj.server_session, group_obj)
82-
print ("Attempting to create {}".format(group_name))
82+
print("Attempting to create {}".format(group_name))
8383
except (DlpxException, RequestError) as e:
8484
print_exception(
8585
"\nERROR: Creating the group {} "
@@ -96,7 +96,7 @@ def delete_group(group_name):
9696

9797
try:
9898
group.delete(dx_session_obj.server_session, group_obj.reference)
99-
print ("Attempting to delete {}".format(group_name))
99+
print("Attempting to delete {}".format(group_name))
100100
except (DlpxException, RequestError) as e:
101101
print_exception(
102102
"\nERROR: Deleting the group {} "
@@ -112,7 +112,7 @@ def list_groups():
112112
group_list = find_all_objects(dx_session_obj.server_session, group)
113113

114114
for group_obj in group_list:
115-
print ("Group: {}".format(group_obj.name))
115+
print("Group: {}".format(group_obj.name))
116116

117117

118118
def run_async(func):

dx_jetstream_container.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@
5555
"""
5656
from __future__ import print_function
5757

58-
VERSION = "v.0.0.005"
59-
60-
6158
import json
6259
import logging
6360
import signal
@@ -82,6 +79,9 @@
8279
from delphixpy.v1_6_0.web.vo import JSBookmarkCreateParameters
8380
from delphixpy.v1_6_0.web.vo import JSTimelinePointLatestTimeInput
8481

82+
VERSION = "v.0.0.005"
83+
84+
8585
# from delphixpy.v1_6_0.web.vo import
8686

8787

dx_jobs.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@
4343
"""
4444
from __future__ import print_function
4545

46-
VERSION = "v.0.0.002"
47-
4846
import re
4947
import sys
5048
from os.path import basename
@@ -64,6 +62,8 @@
6462
from lib.DxLogging import print_info
6563
from lib.GetSession import GetSession
6664

65+
VERSION = "v.0.0.002"
66+
6767

6868
def list_jobs():
6969

@@ -85,7 +85,7 @@ def list_jobs():
8585

8686
if arguments["--title"]:
8787
if re.search(arguments["--title"], job_info.title, re.IGNORECASE):
88-
print (
88+
print(
8989
"Action={}, Job State={}, Parent Action State={},"
9090
"Percent Complete={}, Reference={}, Target={},"
9191
"Target Name={}, Title={}, User={}\n".format(
@@ -101,7 +101,7 @@ def list_jobs():
101101
)
102102
)
103103
else:
104-
print (
104+
print(
105105
"Action=%s, Job State=%s, Parent Action State=%s,"
106106
"Percent Complete=%s, Reference=%s, Target=%s,"
107107
"Target Name=%s, Title=%s, User=%s\n"
@@ -122,7 +122,7 @@ def list_jobs():
122122

123123
if arguments["--title"]:
124124
if re.search(arguments["--title"], job_info.title, re.IGNORECASE):
125-
print (
125+
print(
126126
"Action=%s, Job State=%s, Parent Action State=%s,"
127127
"Percent Complete=%s, Reference=%s, Target=%s,"
128128
"Target Name=%s, Title=%s, User=%s\n"
@@ -139,7 +139,7 @@ def list_jobs():
139139
)
140140
)
141141
else:
142-
print (
142+
print(
143143
"Action=%s, Job State=%s, Parent Action State=%s,"
144144
"Percent Complete=%s, Reference=%s, Target=%s,"
145145
"Target Name=%s, Title=%s, User=%s\n"

0 commit comments

Comments
 (0)