Skip to content

Improve the CI checks to check every single file in the repository #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ jobs:
- name: Install Tox and any other packages
run: pip install tox
- name: Run tox
run: tox
run: tox -- --all-files
21 changes: 11 additions & 10 deletions delphix_admin_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
Will come back and properly throw this with logging, etc
"""
from __future__ import print_function
VERSION = "v.2.3.002"
CONTENTDIR = "/u02/app/content"

import getopt
import logging
Expand All @@ -24,6 +22,9 @@
from delphixpy.v1_6_0.web.vo import PasswordCredential
from delphixpy.v1_6_0.web.vo import User

VERSION = "v.2.3.002"
CONTENTDIR = "/u02/app/content"


def serversess(f_engine_address, f_engine_username, f_engine_password):
"""
Expand All @@ -36,25 +37,25 @@ def serversess(f_engine_address, f_engine_username, f_engine_password):


def help():
print (
print(
"\n"
+ basename(__file__)
+ " [-e <engine ip>] [-o <old delphix_admin password] [-p <new delphix_admin password]"
)
print (
print(
"\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"
)
print ("-h - Prints this message")
print (
print("-h - Prints this message")
print(
"-e <Delphix Engine IP> - Engine must be up, unconfigured, and console screen must be green"
)
print (
print(
"-o <old delphix_admin password> - will use this password to initially access the system"
)
print (
print(
"-p <new delphix_admin password> - will set the delphix_admin user to this password"
)
print ("-v - Print version information and exit")
print("-v - Print version information and exit")
sys.exit(2)


Expand Down Expand Up @@ -126,7 +127,7 @@ def time_elapsed():


def version():
print ("Version: " + VERSION)
print("Version: " + VERSION)
logging_est()
set_exit_handler(on_exit)
sys.exit(1)
Expand Down
12 changes: 7 additions & 5 deletions dx_authorization.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@
"""
from __future__ import print_function

VERSION = "v.0.0.015"

import sys
import traceback
from os.path import basename
Expand Down Expand Up @@ -76,6 +74,8 @@
from lib.GetReferences import find_obj_by_name
from lib.GetSession import GetSession

VERSION = "v.0.0.015"


def create_authorization(dlpx_obj, role_name, target_type, target_name, user_name):
"""
Expand Down Expand Up @@ -196,9 +196,11 @@ def list_authorization(dlpx_obj):
elif auth_obj.target.startswith("DOMAIN"):
target_obj = User()
target_obj.name = "DOMAIN"
print("{}, {}, {}, {}".format(
user_obj.name, role_obj.name, target_obj.name, auth_obj.reference
))
print(
"{}, {}, {}, {}".format(
user_obj.name, role_obj.name, target_obj.name, auth_obj.reference
)
)
except (RequestError, HttpError, JobError, AttributeError) as e:
print_exception(
"An error occurred while listing authorizations.:\n" "{}\n".format((e))
Expand Down
7 changes: 3 additions & 4 deletions dx_delete_vdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@
"""
from __future__ import print_function

VERSION = "v.0.0.001"


import json
import logging
import signal
Expand Down Expand Up @@ -86,6 +83,8 @@
from delphixpy.v1_6_0.web.vo import ASESpecificBackupSyncParameters
from delphixpy.v1_6_0.web.vo import MSSqlSyncParameters

VERSION = "v.0.0.001"


def find_obj_by_name(engine, server, f_class, obj_name):
"""
Expand Down Expand Up @@ -724,7 +723,7 @@ def main(argv):
and not (arguments["--object_type"])
and not (arguments["--all_dbs"])
):
print (__doc__)
print(__doc__)
sys.exit()
# Feed our arguments to the main function, and off we go!
print(arguments)
Expand Down
46 changes: 25 additions & 21 deletions dx_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@
"""
from __future__ import print_function

VERSION = "v.0.3.612"

import sys
import traceback
from os.path import basename
Expand Down Expand Up @@ -103,6 +101,8 @@
from lib.GetReferences import find_obj_name
from lib.GetSession import GetSession

VERSION = "v.0.3.612"


def enable_environment(dlpx_obj, env_name):
"""
Expand All @@ -114,7 +114,7 @@ def enable_environment(dlpx_obj, env_name):

try:
environment.enable(dlpx_obj.server_session, env_obj.reference)
print ("Attempting to enable {}".format(env_name))
print("Attempting to enable {}".format(env_name))
except (DlpxException, RequestError) as e:
print_exception(
"\nERROR: Enabling the host {} "
Expand All @@ -132,7 +132,7 @@ def disable_environment(dlpx_obj, env_name):

try:
environment.disable(dlpx_obj.server_session, env_obj.reference)
print ("Attempting to disable {}".format(env_name))
print("Attempting to disable {}".format(env_name))
except (DlpxException, RequestError) as e:
print_exception(
"\nERROR: Disabling the host {} "
Expand All @@ -155,7 +155,7 @@ def update_host_address(dlpx_obj, old_host_address, new_host_address):
try:
host.update(dlpx_obj.server_session, old_host_obj.reference, host_obj)

print (
print(
"Attempting to update {} to {}".format(old_host_address, new_host_address)
)

Expand Down Expand Up @@ -184,27 +184,31 @@ def list_env(dlpx_obj):
pass

if env.type == "WindowsHostEnvironment":
print (
print(
"Environment Name: {}, Username: {}, Host: {},"
"Enabled: {}, ".format(env.name, env_user, env_host, env.enabled)
)
elif env.type == "WindowsCluster" or env.type == "OracleCluster":
print (
print(
"Environment Name: {}, Username: {}"
"Enabled: {}, ".format(env.name, env_user, env.enabled)
)
else:
print("Environment Name: {}, Username: {}, Host: {}, Enabled: {}," " ASE Environment Params: {}".format(
env.name,
env_user,
env_host,
env.enabled,
env.ase_host_environment_parameters
if isinstance(
env.ase_host_environment_parameters, ASEHostEnvironmentParameters
print(
"Environment Name: {}, Username: {}, Host: {}, Enabled: {},"
" ASE Environment Params: {}".format(
env.name,
env_user,
env_host,
env.enabled,
env.ase_host_environment_parameters
if isinstance(
env.ase_host_environment_parameters,
ASEHostEnvironmentParameters,
)
else "Undefined",
)
else "Undefined",
))
)


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

elif env_obj is None:
print ("Environment was not found in the Engine: {}".format(env_name))
print("Environment was not found in the Engine: {}".format(env_name))
sys.exit(1)


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

except (DlpxException, RequestError, HttpError) as e:
print (
print(
"\nERROR: Encountered an exception while creating the "
"environment:\n{}".format(e)
)
Expand Down Expand Up @@ -440,7 +444,7 @@ def create_windows_env(
if env_obj:
env_params_obj.host_environment.proxy = env_obj.host
elif env_obj is None:
print (
print(
"Host was not found in the Engine: {}".format(
arguments[--connector_name]
)
Expand All @@ -452,7 +456,7 @@ def create_windows_env(
dlpx_obj.jobs[engine_name] = dlpx_obj.server_session.last_job

except (DlpxException, RequestError, HttpError) as e:
print (
print(
"\nERROR: Encountered an exception while creating the "
"environment:\n{}".format(e)
)
Expand Down
10 changes: 5 additions & 5 deletions dx_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@
"""
from __future__ import print_function

VERSION = "v.0.0.002"

import sys
from os.path import basename
from time import sleep
Expand All @@ -69,6 +67,8 @@
from lib.GetReferences import find_obj_by_name
from lib.GetSession import GetSession

VERSION = "v.0.0.002"


def add_group(group_name):
"""
Expand All @@ -79,7 +79,7 @@ def add_group(group_name):

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

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

for group_obj in group_list:
print ("Group: {}".format(group_obj.name))
print("Group: {}".format(group_obj.name))


def run_async(func):
Expand Down
6 changes: 3 additions & 3 deletions dx_jetstream_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@
"""
from __future__ import print_function

VERSION = "v.0.0.005"


import json
import logging
import signal
Expand All @@ -82,6 +79,9 @@
from delphixpy.v1_6_0.web.vo import JSBookmarkCreateParameters
from delphixpy.v1_6_0.web.vo import JSTimelinePointLatestTimeInput

VERSION = "v.0.0.005"


# from delphixpy.v1_6_0.web.vo import


Expand Down
12 changes: 6 additions & 6 deletions dx_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@
"""
from __future__ import print_function

VERSION = "v.0.0.002"

import re
import sys
from os.path import basename
Expand All @@ -64,6 +62,8 @@
from lib.DxLogging import print_info
from lib.GetSession import GetSession

VERSION = "v.0.0.002"


def list_jobs():

Expand All @@ -85,7 +85,7 @@ def list_jobs():

if arguments["--title"]:
if re.search(arguments["--title"], job_info.title, re.IGNORECASE):
print (
print(
"Action={}, Job State={}, Parent Action State={},"
"Percent Complete={}, Reference={}, Target={},"
"Target Name={}, Title={}, User={}\n".format(
Expand All @@ -101,7 +101,7 @@ def list_jobs():
)
)
else:
print (
print(
"Action=%s, Job State=%s, Parent Action State=%s,"
"Percent Complete=%s, Reference=%s, Target=%s,"
"Target Name=%s, Title=%s, User=%s\n"
Expand All @@ -122,7 +122,7 @@ def list_jobs():

if arguments["--title"]:
if re.search(arguments["--title"], job_info.title, re.IGNORECASE):
print (
print(
"Action=%s, Job State=%s, Parent Action State=%s,"
"Percent Complete=%s, Reference=%s, Target=%s,"
"Target Name=%s, Title=%s, User=%s\n"
Expand All @@ -139,7 +139,7 @@ def list_jobs():
)
)
else:
print (
print(
"Action=%s, Job State=%s, Parent Action State=%s,"
"Percent Complete=%s, Reference=%s, Target=%s,"
"Target Name=%s, Title=%s, User=%s\n"
Expand Down
Loading