'Constructor.
This ensures the local bindings for:
SPINNAKER_<platform>_ACCOUNT
SPINNAKER_<platform>_ENABLED
where <platform> is the platform_name or OS for openstack.
It will use the scenario\'s deployed configuration if available and needed
so that these variables will correspond to the agent\'s target.
The default ACCOUNT is the configured primary account.
Args:
platform_name: [string]  Identifies which platform this is.
This should be the name used in the Spinnaker "provider".
scenario: [SpinnakerTestScenario] The scenario being supported.'

def __init__(self, platform_name, scenario):

    self.__lock = threading.Lock()
    self.__observer = None
    self.__scenario = scenario
    self.__platform_name = platform_name
    test_platform_key = (platform_name if (platform_name != 'openstack') else 'os')
    bindings = scenario.bindings
    agent = scenario.agent
    account_key = 'spinnaker_{0}_account'.format(test_platform_key)
    if (not bindings.get(account_key)):
        bindings[account_key] = agent.deployed_config.get('providers.{0}.primaryCredentials.name'.format(platform_name))
    enabled_key = 'spinnaker_{0}_enabled'.format(test_platform_key)
    if (bindings.get(enabled_key, None) is None):
        bindings[enabled_key] = agent.deployed_config.get('providers.{0}.enabled'.format(platform_name))
