2016-02-19 19:21:28 -02:00
|
|
|
from bootstrapvz.base import Task
|
|
|
|
from bootstrapvz.common import phases
|
|
|
|
from bootstrapvz.providers.oracle.apiclient import OracleStorageAPIClient
|
|
|
|
|
|
|
|
|
2016-02-22 21:17:36 -03:00
|
|
|
class Connect(Task):
|
|
|
|
description = 'Connecting to the Oracle Storage Cloud API'
|
2016-02-19 19:21:28 -02:00
|
|
|
phase = phases.preparation
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def run(cls, info):
|
|
|
|
info._oracle['client'] = OracleStorageAPIClient(
|
|
|
|
username=info.manifest.provider['credentials']['username'],
|
|
|
|
password=info.manifest.provider['credentials']['password'],
|
|
|
|
identity_domain=info.manifest.provider['credentials']['identity-domain'],
|
|
|
|
container=info.manifest.provider['container'],
|
|
|
|
)
|
2016-02-22 21:17:36 -03:00
|
|
|
# Try to fetch the token, so it will fail early if the credentials are wrong
|
|
|
|
info._oracle['client'].auth_token
|