mirror of
https://github.com/fastogt/pyfastogt
synced 2025-02-12 13:11:54 +00:00
Sync
This commit is contained in:
parent
884022f3cf
commit
77c30609a9
2 changed files with 14 additions and 1 deletions
|
@ -46,7 +46,11 @@ if __name__ == "__main__":
|
|||
json={'email': argv.email, 'license': argv.license_key, 'project': argv.project,
|
||||
'exp_time': expired_time})
|
||||
|
||||
response = r.json()
|
||||
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)
|
||||
|
|
|
@ -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'])
|
||||
|
|
Loading…
Reference in a new issue