Skip to content

Commit

Permalink
Use logging
Browse files Browse the repository at this point in the history
  • Loading branch information
ColdHeat committed Aug 23, 2024
1 parent 2d70436 commit 8c9b8eb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ctfcli/cli/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@
class ConfigCommand:
def get(self, key):
"""Get the value of a specific remote instance config key"""
log.debug(f"ConfigCommand.get: ({key=})")
return ServerConfig.get(key=key)

def set(self, key, value):
"""Set the value of a specific remote instance config key"""
log.debug(f"ConfigCommand.set: ({key=})")
ServerConfig.set(key=key, value=value)
click.secho(f"Successfully set '{key}' to '{value}'", fg="green")

def pull(self):
"""Copy remote instance configuration values to local config"""
log.debug("ConfigCommand.pull")
server_configs = ServerConfig.getall()

config = Config()
Expand All @@ -39,6 +42,7 @@ def pull(self):

def push(self):
"""Save local instance configuration values to remote CTFd instance"""
log.debug("ConfigCommand.push")
config = Config()
if config.config.has_section("instance") is False:
config.config.add_section("instance")
Expand Down

0 comments on commit 8c9b8eb

Please sign in to comment.