diff --git a/pgmon.py b/pgmon.py index d8848c9..fd70e40 100755 --- a/pgmon.py +++ b/pgmon.py @@ -908,13 +908,13 @@ class Agent: Results are printed to stdout. Params: - config_file: (str) The path to the config file + args: (argparse.Namespace) Command line arguments key: (str) The key indicating the requested metric """ @staticmethod - def run(config_file, key): + def run(args, key): # Read the agent config - config = Config(config_file, read_metrics = False, read_clusters = False) + config = Config(args, read_metrics = False, read_clusters = False) # Connect to the IPC socket ipc = IPC(config, 'agent') @@ -940,18 +940,18 @@ class Server: The server side of the connector Params: - config_file: (str) The path to the config file + args: (argparse.Namespace) Command line arguments Exceptions: """ - def __init__(self, config_file): + def __init__(self, args): # Note the path to the config file so it can be reloaded - self.config_file = config_file + self.config_file = args.config # Load config - self.config = Config(config_file) + self.config = Config(args) # Write pid file # Note: we record the PID file here so it can't be changed with reload @@ -1324,7 +1324,7 @@ def main(): sys.exit("Failed to signal server: {}".format(e)) else: # Start running in agent mode - Agent.run(args.config, args.key) + Agent.run(args, args.key) if __name__ == '__main__':