forked from kizniche/Mycodo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tweak upgrade system, add maintenance mode
- Loading branch information
Showing
9 changed files
with
79 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# config_maintenance.py - Global Mycodo settings | ||
# | ||
|
||
# Maintenance Mode | ||
# Prevents users from installing or upgrading Mycodo | ||
# Used by the developers to test the install/upgrade system for stability prior to release | ||
|
||
MAINTENANCE_MODE = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# -*- coding: utf-8 -*- | ||
# Perform checks used during install/upgrade | ||
|
||
import os | ||
import sys | ||
|
||
sys.path.append(os.path.abspath(os.path.join(__file__, "../../.."))) | ||
|
||
from mycodo.config_maintenance import MAINTENANCE_MODE | ||
|
||
if __name__ == "__main__": | ||
try: | ||
if sys.argv[1] == '--min_python_version': | ||
|
||
if not sys.version_info.major >= int(sys.argv[2].split('.')[0]): | ||
sys.exit(1) | ||
if not sys.version_info.minor >= int(sys.argv[2].split('.')[1]): | ||
sys.exit(1) | ||
|
||
elif sys.argv[1] == '--maintenance_mode': | ||
|
||
if not MAINTENANCE_MODE: | ||
sys.exit(1) | ||
|
||
except: | ||
sys.exit(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/bin/bash | ||
# Downloads the upgrade file | ||
# Downloads the version of Mycodo to upgrade to | ||
|
||
exec 2>&1 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters