mirror of
https://github.com/netinvent/npbackup.git
synced 2025-11-06 19:39:24 +08:00
Don't quit if upgrader detected an interpreted script
This commit is contained in:
parent
d9a2827d2d
commit
290a74cb97
1 changed files with 3 additions and 3 deletions
|
|
@ -51,10 +51,10 @@ def need_upgrade(upgrade_interval: int) -> bool:
|
||||||
# file counter, local, home, or temp if not available
|
# file counter, local, home, or temp if not available
|
||||||
counter_file = "npbackup.autoupgrade.log"
|
counter_file = "npbackup.autoupgrade.log"
|
||||||
|
|
||||||
def _write_count(file: str, counter: int) -> bool:
|
def _write_count(file: str, count: int) -> bool:
|
||||||
try:
|
try:
|
||||||
with open(file, "w") as fpw:
|
with open(file, "w") as fpw:
|
||||||
fpw.write(str(counter))
|
fpw.write(str(count))
|
||||||
return True
|
return True
|
||||||
except OSError:
|
except OSError:
|
||||||
# We may not have write privileges, hence we need a backup plan
|
# We may not have write privileges, hence we need a backup plan
|
||||||
|
|
@ -110,7 +110,7 @@ def auto_upgrader(upgrade_url: str, username: str, password: str) -> bool:
|
||||||
logger.info(
|
logger.info(
|
||||||
"Auto upgrade will only upgrade compiled verions. Please use 'pip install --upgrade npbackup' instead"
|
"Auto upgrade will only upgrade compiled verions. Please use 'pip install --upgrade npbackup' instead"
|
||||||
)
|
)
|
||||||
return True
|
return False
|
||||||
logger.info("Upgrade server is %s", upgrade_url)
|
logger.info("Upgrade server is %s", upgrade_url)
|
||||||
requestor = Requestor(upgrade_url, username, password)
|
requestor = Requestor(upgrade_url, username, password)
|
||||||
requestor.create_session(authenticated=True)
|
requestor.create_session(authenticated=True)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue