-
Notifications
You must be signed in to change notification settings - Fork 687
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removes all EOL related code and tests
- Loading branch information
Showing
5 changed files
with
1 addition
and
184 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,14 @@ | ||
import functools | ||
import subprocess | ||
from datetime import date | ||
|
||
FOCAL_VERSION = "20.04" | ||
|
||
|
||
@functools.lru_cache() | ||
def get_xenial_eol_date() -> date: | ||
return date(2021, 4, 30) | ||
|
||
|
||
@functools.lru_cache() | ||
def get_os_release() -> str: | ||
return subprocess.run( | ||
["lsb_release", "--release", "--short"], | ||
["/usr/bin/lsb_release", "--release", "--short"], | ||
check=True, | ||
stdout=subprocess.PIPE, | ||
universal_newlines=True | ||
).stdout.strip() | ||
|
||
|
||
def is_os_past_eol() -> bool: | ||
""" | ||
Assumption: Any OS that is not Focal is an earlier version of the OS. | ||
""" | ||
if get_os_release() != FOCAL_VERSION and date.today() > get_xenial_eol_date(): | ||
return True | ||
return False | ||
|
||
|
||
def is_os_near_eol() -> bool: | ||
""" | ||
Assumption: Any OS that is not Focal is an earlier version of the OS. | ||
""" | ||
if get_os_release() != FOCAL_VERSION and date.today() <= get_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
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