'Implements interface.'

def add_config(self, options, script):

    if (not options.docker_account_address):
        return
    account_params = [options.docker_account_name, '--address', options.docker_account_address]
    if options.docker_account_credentials:
        cred_basename = os.path.basename(options.docker_account_credentials)
        account_params.extend(['--password-file', cred_basename])
    if options.docker_account_registry_username:
        account_params.extend(['--username', options.docker_account_registry_username])
    if options.docker_account_repositories:
        account_params.extend(['--repositories', options.docker_account_repositories])
    script.append('hal    -q    --log=info    config    provider    docker-registry    enable')
    script.append('hal    -q    --log=info    config    provider    docker-registry    account    add    {params}'.format(params='    '.join(account_params)))
