Skip to content

Conversation

@sourcery-ai
Copy link

@sourcery-ai sourcery-ai bot commented Feb 15, 2023

Branch master refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the master branch, then run:

git fetch origin sourcery/master
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from readcoil February 15, 2023 03:17
Comment on lines -16 to +25
print("WARNING: '"+logPath+"'' doesn't exist. Attempting to create it now.")
print(f"WARNING: '{logPath}'' doesn't exist. Attempting to create it now.")
if not os.path.exists(logdir):
os.makedirs(logdir)
try:
with open(logPath) as file:
pass
except IOError as e:
print("ERROR: Unable to verify '"+logPath+"'' exists. Verify path exists and permission settings. Exiting")
print(
f"ERROR: Unable to verify '{logPath}'' exists. Verify path exists and permission settings. Exiting"
)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 16-23 refactored with the following changes:

Comment on lines -114 to +117
logger.debug("Deleting ElasticSearch index: " + decoded_index + " from " + server)
url = "http://" + server + ":9200/" + decoded_index + "?pretty"
logger.debug(f"Deleting ElasticSearch index: {decoded_index} from {server}")
url = f"http://{server}:9200/{decoded_index}?pretty"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function es_del_index refactored with the following changes:

Comment on lines -120 to +124
logger.debug("List all ElasticSearch indices from " + server)
logger.debug(f"List all ElasticSearch indices from {server}")
#curl -XGET 'localhost:9200/_cat/indices?v&pretty'
url = "http://" + server + ":9200/_cat/indices?v&pretty"
url = f"http://{server}:9200/_cat/indices?v&pretty"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function es_list_index refactored with the following changes:

Comment on lines -126 to +128
logger.debug("Executing ElasticSearch command: {}".format(args))
logger.debug(f"Executing ElasticSearch command: {args}")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function es_main refactored with the following changes:

Comment on lines -144 to +146
logger.info("Creating TimeSketch user: {}".format(username))
logger.info(f"Creating TimeSketch user: {username}")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function create_ts_user refactored with the following changes:

Comment on lines -255 to +257
logger.info("Locally moving file at {} to {}".format(src, dest))
logger.info(f"Locally moving file at {src} to {dest}")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function mv_local refactored with the following changes:

Comment on lines -305 to +310
cdqr_exec = "/usr/local/bin/cdqr.py"
logger.debug("Data Processing: {}".format(args))
logger.debug(f"Data Processing: {args}")
if args.cdqr:
logger.debug("Attempting to process data with CDQR: {}".format(args.cdqr))
logger.debug(f"Attempting to process data with CDQR: {args.cdqr}")
cdqr_exec = "/usr/local/bin/cdqr.py"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function dp_main refactored with the following changes:

usage = "rc_client.py <server IP address or routable domain name> <commands to send to rc_server.py>"
version = "Skadi Automation Client Version: 1.0.0"
print("Starting "+version)
print(f"Starting {version}")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function main refactored with the following changes:

Comment on lines -29 to -30
# missing associated documentation comment in .proto file
pass
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function RCServicer.ExecuteRC refactored with the following changes:

This removes the following comments ( why? ):

# missing associated documentation comment in .proto file

def main():
version = "Skadi Automation Server Version: 1.0.0"
print("Starting "+version)
print(f"Starting {version}")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function main refactored with the following changes:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant