move service and instance credential id to config file, timestamp credential name
This commit is contained in:
parent
60140d149c
commit
228b917116
|
@ -2,3 +2,6 @@
|
||||||
ALKIRA_TENANT = mytenant.preprod.alkira3.net
|
ALKIRA_TENANT = mytenant.preprod.alkira3.net
|
||||||
ALKIRA_USERNAME = <username>
|
ALKIRA_USERNAME = <username>
|
||||||
ALKIRA_PASSWORD = <password>
|
ALKIRA_PASSWORD = <password>
|
||||||
|
[services]
|
||||||
|
SERVICE_USERNAME = admin
|
||||||
|
SERVICE_PASSWORD = Blabla123
|
||||||
|
|
9
push.py
9
push.py
|
@ -68,6 +68,8 @@ ALKIRA_TENANT = alkira.get('alkira', 'ALKIRA_TENANT')
|
||||||
ALKIRA_USERNAME = alkira.get('alkira', 'ALKIRA_USERNAME')
|
ALKIRA_USERNAME = alkira.get('alkira', 'ALKIRA_USERNAME')
|
||||||
ALKIRA_PASSWORD = alkira.get('alkira', 'ALKIRA_PASSWORD')
|
ALKIRA_PASSWORD = alkira.get('alkira', 'ALKIRA_PASSWORD')
|
||||||
ALKIRA_BASE_URI = f'https://{ALKIRA_TENANT}/api'
|
ALKIRA_BASE_URI = f'https://{ALKIRA_TENANT}/api'
|
||||||
|
SERVICE_USERNAME = alkira.get('services', 'SERVICE_USERNAME')
|
||||||
|
SERVICE_PASSWORD = alkira.get('services', 'SERVICE_PASSWORD')
|
||||||
|
|
||||||
# Connector config
|
# Connector config
|
||||||
if not os.path.isfile(CONNECTOR_CONFIG):
|
if not os.path.isfile(CONNECTOR_CONFIG):
|
||||||
|
@ -148,12 +150,13 @@ def alkira_delete(session, uri):
|
||||||
return response
|
return response
|
||||||
|
|
||||||
def alkira_service(session, connector_name):
|
def alkira_service(session, connector_name):
|
||||||
|
fwcredential = f'fwcredential-{time.time()}'
|
||||||
body = {
|
body = {
|
||||||
"credentials": {
|
"credentials": {
|
||||||
"userName": "admin",
|
"userName": SERVICE_USERNAME,
|
||||||
"password": "Blabla123"
|
"password": SERVICE_PASSWORD
|
||||||
},
|
},
|
||||||
"name": "fwcredentials00"
|
"name": fwcredential
|
||||||
}
|
}
|
||||||
logging.debug(f'Received Connector: {connector_name}')
|
logging.debug(f'Received Connector: {connector_name}')
|
||||||
logging.info('=== Create Credentials')
|
logging.info('=== Create Credentials')
|
||||||
|
|
Loading…
Reference in New Issue