1
0
Fork 0
mirror of https://github.com/fastogt/pyfastogt synced 2025-02-12 16:11:51 +00:00
This commit is contained in:
topilski 2020-03-12 09:38:30 -04:00
parent 884022f3cf
commit 77c30609a9
2 changed files with 14 additions and 1 deletions

View file

@ -46,7 +46,11 @@ if __name__ == "__main__":
json={'email': argv.email, 'license': argv.license_key, 'project': argv.project,
'exp_time': expired_time})
try:
response = r.json()
except:
response = {'error': 'Invalid response'}
if r.status_code == 200 or r.status_code == 201:
print(response['exp_license'])
sys.exit(0)

View file

@ -7,6 +7,7 @@ import tarfile
import json
import ssl
import certifi
import contextlib
from validate_email import validate_email
from urllib.request import urlopen
@ -176,3 +177,11 @@ def binary_search_impl(number, array, lo, hi):
def binary_search_number(anum, array): # convenience interface to binary_search()
return binary_search_impl(anum, array, 0, len(array) - 1)
def regenerate_dbus_machine_id():
with contextlib.suppress(FileNotFoundError):
os.remove('/var/lib/dbus/machine-id')
with contextlib.suppress(FileNotFoundError):
os.remove('/etc/machine-id')
subprocess.call(['dbus-uuidgen', '--ensure'])