Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
Signed-off-by: Andre Kurait <[email protected]>
  • Loading branch information
AndreKurait committed Jun 25, 2024
1 parent fd12769 commit 3351c06
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ def get_metrics_data_cmd(ctx, component, metric_name, statistic, lookback):

# ##################### UTILITIES ###################


@cli.command()
@click.option(
"--config-file", default="/etc/migration_services.yaml", help="Path to config file"
Expand Down Expand Up @@ -348,16 +349,16 @@ def completion(ctx, config_file, json, shell):

try:
completion_script = completion_class(lambda: cli(ctx, config_file, json),
{},
"console",
{},
"console",
"_CONSOLE_COMPLETE").source()
click.echo(completion_script)
except RuntimeError as exc:
click.echo(f"Error: {exc}", err=True)
ctx.exit(1)


#################################################

if __name__ == "__main__":
cli()

Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ def create(self, *args, **kwargs) -> CommandResult:
command.append("--target-insecure")
if not wait:
command.append("--no-wait")
if max_snapshot_rate_mb_per_node is not None:
command.extend(["--max-snapshot-rate-mb-per-node",
str(max_snapshot_rate_mb_per_node)])

logger.info(f"Creating snapshot with command: {' '.join(command)}")
try:
Expand All @@ -129,8 +132,6 @@ def __init__(self, config: Dict, source_cluster: Cluster, target_cluster: Cluste

def create(self, *args, **kwargs) -> CommandResult:
assert isinstance(self.target_cluster, Cluster)
wait = kwargs.get('wait', False)
max_snapshot_rate_mb_per_node = kwargs.get('max_snapshot_rate_mb_per_node', None)

if self.source_cluster.auth_type != AuthMethod.NO_AUTH:
raise NotImplementedError("Source cluster authentication is not supported for creating snapshots")
Expand All @@ -147,11 +148,6 @@ def create(self, *args, **kwargs) -> CommandResult:

if self.source_cluster.allow_insecure:
command.append("--source-insecure")
if not wait:
command.append("--no-wait")
if max_snapshot_rate_mb_per_node is not None:
command.extend(["--max-snapshot-rate-mb-per-node",
str(max_snapshot_rate_mb_per_node)])

logger.info(f"Creating snapshot with command: {' '.join(command)}")
try:
Expand Down

0 comments on commit 3351c06

Please sign in to comment.