summaryrefslogtreecommitdiffstats
path: root/cli/objects/client.py
diff options
context:
space:
mode:
authorJose M. Guisado <jguisado@soleta.eu>2022-05-20 10:22:42 +0200
committerJose M. Guisado <jguisado@soleta.eu>2022-05-20 10:22:42 +0200
commitd90ab82cec328004e743b2bfbb7c25b32eb299ea (patch)
treefcfbfd01f3517631119b7f41ae8363e1259177bd /cli/objects/client.py
parentf88bcf78ac9ffefcedfb4e108b703dac40ca5839 (diff)
format: use autopep8
Use autopep8 for coding format, and only for whitespace changes. This change drops use of tabs in favor of spaces. Doesn't use autopep8 --aggresive option. Format command: $ autopep8 --inline --recursive . When using git-blame, use --ignore-rev in order to ignore this reformatting commit.
Diffstat (limited to 'cli/objects/client.py')
-rw-r--r--cli/objects/client.py89
1 files changed, 45 insertions, 44 deletions
diff --git a/cli/objects/client.py b/cli/objects/client.py
index 4dc64fd..dbb7f15 100644
--- a/cli/objects/client.py
+++ b/cli/objects/client.py
@@ -9,49 +9,50 @@ import argparse
from cli.utils import print_json
+
class OgClient():
- @staticmethod
- def list_clients(rest):
- r = rest.get('/clients')
- print_json(r.text)
-
- @staticmethod
- def list_client_hardware(rest, args):
- parser = argparse.ArgumentParser()
- parser.add_argument('--client-ip',
- nargs=1,
- type=str,
- required=True,
- help='client IP')
- parsed_args = parser.parse_args(args)
-
- payload = {'client': parsed_args.client_ip}
- r = rest.get('/hardware', payload=payload)
- print_json(r.text)
-
- @staticmethod
- def get_client_properties(rest, args):
- parser = argparse.ArgumentParser()
- parser.add_argument('--client-ip',
- nargs=1,
- required=True,
- help='client IP')
- parsed_args = parser.parse_args(args)
-
- payload = {'client': parsed_args.client_ip}
- r = rest.get('/client/info', payload=payload)
- print_json(r.text)
-
- @staticmethod
- def send_refresh(rest, args):
- parser = argparse.ArgumentParser()
- parser.add_argument('--client-ip',
- action='append',
- default=[],
- required=True,
- help='Client IP')
- parsed_args = parser.parse_args(args)
-
- payload = {'clients': parsed_args.client_ip}
- rest.post('/refresh', payload=payload)
+ @staticmethod
+ def list_clients(rest):
+ r = rest.get('/clients')
+ print_json(r.text)
+
+ @staticmethod
+ def list_client_hardware(rest, args):
+ parser = argparse.ArgumentParser()
+ parser.add_argument('--client-ip',
+ nargs=1,
+ type=str,
+ required=True,
+ help='client IP')
+ parsed_args = parser.parse_args(args)
+
+ payload = {'client': parsed_args.client_ip}
+ r = rest.get('/hardware', payload=payload)
+ print_json(r.text)
+
+ @staticmethod
+ def get_client_properties(rest, args):
+ parser = argparse.ArgumentParser()
+ parser.add_argument('--client-ip',
+ nargs=1,
+ required=True,
+ help='client IP')
+ parsed_args = parser.parse_args(args)
+
+ payload = {'client': parsed_args.client_ip}
+ r = rest.get('/client/info', payload=payload)
+ print_json(r.text)
+
+ @staticmethod
+ def send_refresh(rest, args):
+ parser = argparse.ArgumentParser()
+ parser.add_argument('--client-ip',
+ action='append',
+ default=[],
+ required=True,
+ help='Client IP')
+ parsed_args = parser.parse_args(args)
+
+ payload = {'clients': parsed_args.client_ip}
+ rest.post('/refresh', payload=payload)