def _get_handler(profile, project, location): """Return instantiated profile object. profile: name of the installation profile. To define additional profile handlers: 1. Create a new profile class (example below) 2. Add profile & class name to profiles dict in _get_profile_handler(). """ profiles = {'import': _ImportProfile, 'restore': _RestoreProfile} if profile not in profiles.keys(): profile = onramp.get_onramp_profile(location) return profiles[profile](project)
def _get_handler(profile, project, location): """Return instantiated profile object. profile: name of the installation profile. To define additional profile handlers: 1. Create a new profile class (example below) 2. Add profile & class name to profiles dict in _get_profile_handler(). """ profiles = {'import': _ImportProfile, 'restore': _RestoreProfile} # If the profile is not pre-defined try to determine if it is a restore # or an import (we may not know if they are uploading a pantheon backup or # their own existing site). Defaults to 'onramp'. if profile not in profiles.keys(): profile = onramp.get_onramp_profile(location) return profiles[profile](project)