Skip to content
This repository has been archived by the owner on Feb 20, 2018. It is now read-only.

Commit

Permalink
Set default admin password for endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
sh0ked committed Mar 21, 2017
1 parent c634487 commit 1d1f707
Show file tree
Hide file tree
Showing 15 changed files with 239 additions and 267 deletions.
5 changes: 2 additions & 3 deletions config_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ class Config(object):
OPENSTACK_PING_RETRY_COUNT = 3
OPENSTACK_DEFAULT_FLAVOR = ''
OPENASTACK_VM_META_DATA = {
'admin_pass': 'testPassw0rd.',
'adminPass': 'testPassw0rd.'
'admin_pass': 'testPassw0rd.'
}
OPENSTACK_VM_USERDATA_FILE_PATH = "%s/userdata" % os.path.abspath(os.curdir)

VM_CREATE_CHECK_PAUSE = 5
VM_CREATE_CHECK_ATTEMPTS = 1000
Expand All @@ -64,4 +64,3 @@ class Config(object):
VMMASTER_AGENT_PORT = 9000

THREAD_POOL_MAX = 100

3 changes: 0 additions & 3 deletions core/constants.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# -*- coding: utf-8 -*-


SESSION_CLOSE_REASON_API_CALL = "Session closed via API stop_session call"
GET_ENDPOINT_ATTEMPTS = 10
GET_ENDPOINT_WAIT_TIME_INCREMENT = 5

ENDPOINT_REBUILD_ATTEMPTS = 3
REQUEST_TIMEOUT = 120
16 changes: 0 additions & 16 deletions core/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,6 @@ class SessionException(Exception):
pass


class ClonesException(Exception):
pass


class NoMacError(Exception):
pass


class CreationException(Exception):
pass

Expand All @@ -37,11 +29,3 @@ class TimeoutException(Exception):

class ConnectionError(Exception):
pass


class NoSuchEndpoint(Exception):
pass


class QueueItemNotFound(Exception):
pass
5 changes: 3 additions & 2 deletions core/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ def save_artifacts(self):
artifacts = {
"selenium_server": "/var/log/selenium_server.log"
}
if not self.endpoint_ip:
return False
return self.endpoint.save_artifacts(self, artifacts)

def close(self, reason=None):
Expand Down Expand Up @@ -219,8 +221,7 @@ def req():

response = q.get()
if isinstance(response, requests.Timeout):
raise RequestTimeoutException("No response for '%s' in %s sec. Original: %s"
% (url, timeout, response))
raise RequestTimeoutException("No response for '%s' in %s sec. Original: %s" % (url, timeout, response))
if isinstance(response, Exception):
raise RequestException("Error for '%s'. Original: %s" % (url, response))

Expand Down
2 changes: 0 additions & 2 deletions tests/run_unittests.py

This file was deleted.

1 change: 1 addition & 0 deletions tests/unit/data/config_openstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class Config(object):
OPENASTACK_VM_META_DATA = {
'admin_pass': 'testPassw0rd.'
}
OPENSTACK_VM_USERDATA_FILE_PATH = "%s/tests/unit/data/userdata" % os.path.abspath(os.curdir)

VM_CHECK = False
VM_CHECK_FREQUENCY = 1800
Expand Down
3 changes: 3 additions & 0 deletions tests/unit/data/userdata
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#cloud-config
password: pass
chpasswd: {expire: False}
2 changes: 1 addition & 1 deletion tests/unit/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,4 +285,4 @@ def delete(self):
body = json.loads(response.data)
self.assertEqual(200, body['metacode'])
self.assertEqual("This endpoints were deleted from pool: "
"[%s]" % vm_name_1, body['result'])
"%s" % [vm_name_1], body['result'])
Loading

0 comments on commit 1d1f707

Please sign in to comment.