From 1e4fb13cd4ff17f9006702c29d35203eb5b12d6e Mon Sep 17 00:00:00 2001 From: "Chayim I. Kirshen" Date: Wed, 15 Mar 2023 15:04:21 +0200 Subject: [PATCH 1/2] Adding a short option for generate-only (-g) --- redisenv/commands/cluster.py | 1 + redisenv/commands/enterprise.py | 1 + redisenv/commands/replica.py | 1 + redisenv/commands/sentinel.py | 3 ++- redisenv/commands/standalone.py | 1 + 5 files changed, 6 insertions(+), 1 deletion(-) diff --git a/redisenv/commands/cluster.py b/redisenv/commands/cluster.py index fac8c29..829aed6 100644 --- a/redisenv/commands/cluster.py +++ b/redisenv/commands/cluster.py @@ -70,6 +70,7 @@ def cluster(): ) @click.option( "--generate-only", + "-g", help="set, to only generate the configurations, and not run them", is_flag=True, default=False, diff --git a/redisenv/commands/enterprise.py b/redisenv/commands/enterprise.py index 0aa92e0..bd9d443 100644 --- a/redisenv/commands/enterprise.py +++ b/redisenv/commands/enterprise.py @@ -75,6 +75,7 @@ def enterprise(): ) @click.option( "--generate-only", + "-g", help="set, to only generate the configurations, and not run them", is_flag=True, default=False, diff --git a/redisenv/commands/replica.py b/redisenv/commands/replica.py index 32b0594..162ea5b 100644 --- a/redisenv/commands/replica.py +++ b/redisenv/commands/replica.py @@ -83,6 +83,7 @@ def replica(): ) @click.option( "--generate-only", + "-g", help="set, to only generate the configurations, and not run them", is_flag=True, default=False, diff --git a/redisenv/commands/sentinel.py b/redisenv/commands/sentinel.py index 9eaa96a..28c94c3 100644 --- a/redisenv/commands/sentinel.py +++ b/redisenv/commands/sentinel.py @@ -9,7 +9,7 @@ def sentinel(): - """create a redis-sentinel environment""" + """create a redis-sentinel environment, one redis server and multiple sentinels behind it""" @click.command() @@ -88,6 +88,7 @@ def sentinel(): ) @click.option( "--generate-only", + "-g", help="set, to only generate the configurations, and not run them", is_flag=True, default=False, diff --git a/redisenv/commands/standalone.py b/redisenv/commands/standalone.py index 58470b6..81e08ca 100644 --- a/redisenv/commands/standalone.py +++ b/redisenv/commands/standalone.py @@ -71,6 +71,7 @@ def standalone(): ) @click.option( "--generate-only", + "-g", help="set, to only generate the configurations, and not run them", is_flag=True, default=False, From 7c9d86187b6850fa4714893e6c4f6efb1f8c9add Mon Sep 17 00:00:00 2001 From: "Chayim I. Kirshen" Date: Thu, 16 Mar 2023 09:21:53 +0200 Subject: [PATCH 2/2] lint --- redisenv/__main__.py | 3 +-- redisenv/commands/enterprise.py | 3 +-- redisenv/env.py | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/redisenv/__main__.py b/redisenv/__main__.py index 4f6c6d1..a93837d 100644 --- a/redisenv/__main__.py +++ b/redisenv/__main__.py @@ -1,7 +1,6 @@ # This layout exists, specifically to make poetry+extras work def main(): - from .commands import (cli, cluster, enterprise, replica, sentinel, - standalone) + from .commands import cli, cluster, enterprise, replica, sentinel, standalone cli.group(standalone.standalone).add_command(standalone.create) diff --git a/redisenv/commands/enterprise.py b/redisenv/commands/enterprise.py index bd9d443..2592b0e 100644 --- a/redisenv/commands/enterprise.py +++ b/redisenv/commands/enterprise.py @@ -5,8 +5,7 @@ from loguru import logger from ..composer import DockerComposeWrapper -from ..env import (ENTERPRISE_CLUSTER_TYPE, EnterpriseClusterHandler, - _default_options) +from ..env import ENTERPRISE_CLUSTER_TYPE, EnterpriseClusterHandler, _default_options from ..util import free_ports from . import defaultenvname diff --git a/redisenv/env.py b/redisenv/env.py index 2b6db5c..99750d8 100644 --- a/redisenv/env.py +++ b/redisenv/env.py @@ -51,7 +51,7 @@ def __init__( os.makedirs(self.envconfigdir, exist_ok=True) if disable_logging: logger.disable("redisenv") - + def listenvs(self): """List the environments"""