diff options
author | Alice Ferrazzi <alicef@gentoo.org> | 2017-06-20 00:00:40 +0000 |
---|---|---|
committer | Alice Ferrazzi <alicef@gentoo.org> | 2017-06-20 00:00:40 +0000 |
commit | 95a7ff85a9b9c1544bafa789fc9115bf92db7d96 (patch) | |
tree | 6b26ca8de5b6a386ab2ee9493d3911b9e790bcd0 | |
parent | Merge branch 'master' of https://github.com/aliceinwire/elivepatch (diff) | |
download | elivepatch-95a7ff85a9b9c1544bafa789fc9115bf92db7d96.tar.gz elivepatch-95a7ff85a9b9c1544bafa789fc9115bf92db7d96.tar.bz2 elivepatch-95a7ff85a9b9c1544bafa789fc9115bf92db7d96.zip |
made client config post function
-rw-r--r-- | elivepatch_client/bin/elivepatch | 3 | ||||
-rw-r--r-- | elivepatch_client/client/cli.py | 6 | ||||
-rw-r--r-- | elivepatch_client/client/restful.py | 3 |
3 files changed, 3 insertions, 9 deletions
diff --git a/elivepatch_client/bin/elivepatch b/elivepatch_client/bin/elivepatch index 51b7226..c5d1f7f 100644 --- a/elivepatch_client/bin/elivepatch +++ b/elivepatch_client/bin/elivepatch @@ -21,6 +21,7 @@ __version__ = "0.0.1" #------------------------------------------------------------------------------- from elivepatch_client.client.argsparser import ArgsParser from elivepatch_client.client.cli import Main +#import pdb; pdb.set_trace() import os #=============================================================================== @@ -39,4 +40,4 @@ main = Main(ArgsParser()) try: main() except KeyboardInterrupt: - print('Interrupt received, exiting...')
\ No newline at end of file + print('Interrupt received, exiting...') diff --git a/elivepatch_client/client/cli.py b/elivepatch_client/client/cli.py index ff8fb61..e6ae614 100644 --- a/elivepatch_client/client/cli.py +++ b/elivepatch_client/client/cli.py @@ -35,11 +35,6 @@ class Main(object): def __init__(self, argparser): config = argparser.get_arg() self.dispatch(config) - # print(config) - # print(Kernel().get_version()) - # self.url = config.url - # self.send_config() - def dispatch(self, config): print(str(config)) @@ -49,7 +44,6 @@ class Main(object): elif config.patch: print('working with patch') current_kernel = Kernel() - print(current_kernel.get_version()) current_kernel.get_config(config.config) current_kernel.send_config(config.url) elif config.version: diff --git a/elivepatch_client/client/restful.py b/elivepatch_client/client/restful.py index 7ee7c71..0482bbb 100644 --- a/elivepatch_client/client/restful.py +++ b/elivepatch_client/client/restful.py @@ -7,7 +7,6 @@ from requests.auth import HTTPBasicAuth class ManaGer(object): def __init__(self, server_url): self.server_url = server_url - self.version() def version(self): url = self.server_url + '/elivepatch/api/v1.0/agent' @@ -18,7 +17,7 @@ class ManaGer(object): print(r.json()) def send_config(self, send_file, name_file): - url = self.server_url + url = self.server_url+'/elivepatch/api/v1.0/config' headers = {'elivepatch': 'password'} files = {'file': (name_file, open(send_file, 'rb'), 'multipart/form-data', {'Expires': '0'})} r = requests.post(url, files=files, headers=headers) |