-
Notifications
You must be signed in to change notification settings - Fork 697
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Allie Crevier <[email protected]>
- Loading branch information
Allie Crevier
committed
Feb 13, 2021
1 parent
b58cc07
commit 6973797
Showing
6 changed files
with
135 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from datetime import date | ||
from source_app.decorators import ignore_static | ||
import platform | ||
|
||
FOCAL_VER = "20.04" | ||
XENIAL_EOL_DATE = date(2021, 4, 30) | ||
|
||
with open("/etc/lsb-release", "r") as f: | ||
server_os = f.readlines()[1].split("=")[1].strip("\n") | ||
|
||
def is_server_os_past_eol(): | ||
""" | ||
Assumption: Any OS that is not Focal is an earlier version of the OS. | ||
""" | ||
if (server_os != FOCAL_VER and date.today() > XENIAL_EOL_DATE): | ||
return True | ||
return False | ||
|
||
def is_server_os_close_to_eol(): | ||
""" | ||
Assumption: Any OS that is not Focal is an earlier version of the OS. | ||
""" | ||
if (server_os != FOCAL_VER and date.today() <= XENIAL_EOL_DATE): | ||
return True | ||
return False |
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,25 @@ | ||
from datetime import date | ||
from source_app.decorators import ignore_static | ||
import platform | ||
|
||
FOCAL_VER = "20.04" | ||
XENIAL_EOL_DATE = date(2021, 4, 30) | ||
|
||
with open("/etc/lsb-release", "r") as f: | ||
server_os = f.readlines()[1].split("=")[1].strip("\n") | ||
|
||
def is_server_os_past_eol(): | ||
""" | ||
Assumption: Any OS that is not Focal is an earlier version of the OS. | ||
""" | ||
if (server_os != FOCAL_VER and date.today() > XENIAL_EOL_DATE): | ||
return True | ||
return False | ||
|
||
def is_server_os_close_to_eol(): | ||
""" | ||
Assumption: Any OS that is not Focal is an earlier version of the OS. | ||
""" | ||
if (server_os != FOCAL_VER and date.today() <= XENIAL_EOL_DATE): | ||
return True | ||
return False |
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