Fix "Unable to remove via --remove option for Snap package" (Close #161)

This commit is contained in:
Adnan Hodzic 2021-02-02 20:56:56 +01:00
parent 3e6d1314b3
commit 5e38ada748
2 changed files with 6 additions and 3 deletions

View File

@ -209,7 +209,7 @@ def deploy_complete_msg():
def remove_complete_msg():
print("\n" + "-" * 25 + " auto-cpufreq daemon removed " + "-" * 25 + "\n")
print("auto-cpufreq successfully removed.")
footer()
def deploy_daemon():
print("\n" + "-" * 21 + " Deploying auto-cpufreq as a daemon " + "-" * 22 + "\n")

View File

@ -121,8 +121,11 @@ def main(monitor, live, daemon, install, log, debug):
root_check()
run("snapctl set daemon=disabled", shell=True)
run("snapctl stop --disable auto-cpufreq", shell=True)
if auto_cpufreq_log_file.exists():
auto_cpufreq_log_file.unlink()
if auto_cpufreq_log_path.exists():
if auto_cpufreq_log_file is not None:
auto_cpufreq_log_file.close()
auto_cpufreq_log_path.unlink()
remove_complete_msg()
else:
root_check()