def get_plain_auth(): try: config.load_config_file() plain_auth = auth.plain_auth() return plain_auth except Exception as exc: click.secho(str(exc), fg="yellow", bold=True, err=True) warn_inexsit_config() sys.exit(1)
def get_resources(): try: config.load_config_file() s3_resource = auth.resource() return s3_resource except Exception as exc: click.secho(str(exc), fg="yellow", bold=True, err=True) warn_inexsit_config() sys.exit(1)
def get_admin_client(): try: config.load_config_file() admin_client = auth.admin_client() return admin_client except Exception as exc: click.secho(str(exc), fg="yellow", bold=True, err=True) msg = (f"Configuration file not available.\n" f"Consider running 'obs --configure' to create one") click.secho(msg, fg="yellow", bold=True, err=True) sys.exit(1)
def gmt_cmd(policy_id): """Manage Cloudian extensions to S3.""" if policy_id: config.load_config_file() gmt.show_policies()