Skip to content
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

Force #48

Merged
merged 4 commits into from Oct 4, 2013
Merged

Force #48

Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Next

pull out this destfile value

  • Loading branch information
Mike Blume
Mike Blume committed Oct 3, 2013
commit a70146818cd72375e44af907330e31791c2e37fe
@@ -931,38 +931,30 @@ def create_loggly_config_file(syslog_id, syslog_configuration_details,
config_file = open(file_path, "w")
config_file.write(content)
config_file.close()
destfile = os.path.join(syslog_configuration_details.get("path"),
LOGGLY_CONFIG_FILE)
if user_type == NON_ROOT_USER:
# print Instructions...
content = "mv -f %s %s\n%s" % (file_path,
os.path.join(syslog_configuration_details.get("path"),
LOGGLY_CONFIG_FILE), command_content)
content = "mv -f %s %s\n%s" % (file_path, destfile, command_content)
create_bash_script(content)
else:
if os.path.isfile(os.path.join(
syslog_configuration_details.get("path"), LOGGLY_CONFIG_FILE)):
if os.path.isfile(destfile):
msg = ("Loggly configuration file (%s) is already present. "
"Do you want to overwrite it? [Yes|No]: "
% os.path.join(syslog_configuration_details.get("path"),
LOGGLY_CONFIG_FILE))
"Do you want to overwrite it? [Yes|No]: " % destfile)

for _ in range(5):
user_input = usr_input(msg).lower()
if len(user_input) > 0:
if user_input in yes:
os.popen("mv -f %s %s" % (file_path,
os.path.join(
syslog_configuration_details.get("path"),
LOGGLY_CONFIG_FILE)))
os.popen("mv -f %s %s" % (file_path, destfile))
return
elif user_input in no:
printMessage("Finished")
sys.exit(0)
else:
printLog("Not a valid input. Please retry.")
else:
os.popen("mv -f %s %s" % (file_path,
os.path.join(syslog_configuration_details.get("path"),
LOGGLY_CONFIG_FILE)))
os.popen("mv -f %s %s" % (file_path, destfile))
return

printLog("Invalid input received after maximum attempts.")
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.