forked from uncloud/uncloud
phase in notion of a product
This commit is contained in:
parent
55a2de72c8
commit
3b508fc87d
3 changed files with 100 additions and 4 deletions
|
|
@ -55,6 +55,8 @@ def authenticate(username, password, totp_token=None):
|
|||
server = ldap3.Server("ldaps://ldap1.ungleich.ch")
|
||||
dn = "uid={},ou=customer,dc=ungleich,dc=ch".format(username)
|
||||
|
||||
log.debug("LDAP: connecting to {} as {}".format(server, dn))
|
||||
|
||||
try:
|
||||
conn = ldap3.Connection(server, dn, password, auto_bind=True)
|
||||
except ldap3.core.exceptions.LDAPBindError as e:
|
||||
|
|
@ -72,12 +74,12 @@ def order(config):
|
|||
if not config.arguments[required_arg]:
|
||||
raise UncloudException("Missing required argument: {}".format(required_arg))
|
||||
|
||||
print(config.arguments)
|
||||
log.debug(config.arguments)
|
||||
authenticate(config.arguments['username'], config.arguments['password'])
|
||||
|
||||
# create DB entry for VM
|
||||
vm = VM(config)
|
||||
vm.schedule()
|
||||
vm.product.place_order()
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue