syncloud-lib 359__tar.gz → 361__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {syncloud_lib-359/syncloud_lib.egg-info → syncloud_lib-361}/PKG-INFO +1 -1
- {syncloud_lib-359 → syncloud_lib-361/syncloud_lib.egg-info}/PKG-INFO +1 -1
- {syncloud_lib-359 → syncloud_lib-361}/syncloudlib/integration/device.py +26 -0
- {syncloud_lib-359 → syncloud_lib-361}/syncloudlib/integration/selenium_wrapper.py +2 -0
- syncloud_lib-361/version +1 -0
- syncloud_lib-359/version +0 -1
- {syncloud_lib-359 → syncloud_lib-361}/LICENSE +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/MANIFEST.in +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/requirements.txt +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/setup.cfg +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/setup.py +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/syncloud_lib.egg-info/SOURCES.txt +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/syncloud_lib.egg-info/dependency_links.txt +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/syncloud_lib.egg-info/requires.txt +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/syncloud_lib.egg-info/top_level.txt +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/syncloudlib/__init__.py +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/syncloudlib/application/__init__.py +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/syncloudlib/application/config.py +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/syncloudlib/application/connection.py +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/syncloudlib/application/paths.py +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/syncloudlib/application/ports.py +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/syncloudlib/application/service.py +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/syncloudlib/application/storage.py +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/syncloudlib/application/urls.py +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/syncloudlib/application/users.py +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/syncloudlib/error.py +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/syncloudlib/fs.py +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/syncloudlib/http.py +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/syncloudlib/integration/__init__.py +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/syncloudlib/integration/conftest.py +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/syncloudlib/integration/hosts.py +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/syncloudlib/integration/installer.py +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/syncloudlib/integration/loop.py +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/syncloudlib/integration/screenshots.py +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/syncloudlib/integration/ssh.py +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/syncloudlib/json/__init__.py +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/syncloudlib/json/convertible.py +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/syncloudlib/linux.py +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/syncloudlib/logger.py +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/test/application/test_connection.py +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/test/application/test_paths.py +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/test/application/test_service.py +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/test/application/test_storage.py +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/test/application/test_urls.py +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/test/integration/test_hosts.py +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/test/integration/test_installer.py +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/test/integration/test_loop.py +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/test/integration/test_ssh.py +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/test/json/test_convertible.py +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/test/test_fs.py +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/test/test_linux.py +0 -0
- {syncloud_lib-359 → syncloud_lib-361}/test/test_logger.py +0 -0
|
@@ -107,5 +107,31 @@ class Device:
|
|
|
107
107
|
return run_scp('-r {0} root@{1}:{2}'.format(dir_from, self.domain, dir_to), password=self.ssh_password,
|
|
108
108
|
throw=throw)
|
|
109
109
|
|
|
110
|
+
def login_v2(self, retries=5):
|
|
111
|
+
session = requests.session()
|
|
112
|
+
session.mount('https://{0}'.format(self.domain), HTTPAdapter(max_retries=retries))
|
|
113
|
+
retry = 0
|
|
114
|
+
while True:
|
|
115
|
+
try:
|
|
116
|
+
token = run_ssh(self.domain,
|
|
117
|
+
'snap run platform.cli login {0} {1}'.format(self.device_user, self.device_password),
|
|
118
|
+
password=self.ssh_password)
|
|
119
|
+
token = token.strip()
|
|
120
|
+
response = session.post('https://{0}/rest/login/token'.format(self.domain), verify=False,
|
|
121
|
+
allow_redirects=False, json={'token': token})
|
|
122
|
+
if response.status_code != 200:
|
|
123
|
+
raise Exception('token login failed: {0}'.format(response.text))
|
|
124
|
+
response = session.get('https://{0}/rest/user'.format(self.domain), verify=False,
|
|
125
|
+
allow_redirects=False)
|
|
126
|
+
if response.status_code == 200:
|
|
127
|
+
self.session = session
|
|
128
|
+
return session
|
|
129
|
+
except Exception as e:
|
|
130
|
+
print(str(e))
|
|
131
|
+
print('retry {0} of {1}'.format(retry, retries))
|
|
132
|
+
retry += 1
|
|
133
|
+
if retry > retries:
|
|
134
|
+
raise Exception('cannot login')
|
|
135
|
+
|
|
110
136
|
def http_get(self, url):
|
|
111
137
|
return self.session.get('https://{0}{1}'.format(self.domain, url), allow_redirects=False, verify=False)
|
syncloud_lib-361/version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
361
|
syncloud_lib-359/version
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
359
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|