You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@warble.apache.org by hu...@apache.org on 2018/06/26 22:05:58 UTC

[incubator-warble-server] 03/05: add an 'unverify' command

This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-warble-server.git

commit 230a7630cf54baa1a908eba6951f0b0e084498ea
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Tue Jun 26 16:59:59 2018 -0500

    add an 'unverify' command
---
 tools/cli.py | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/tools/cli.py b/tools/cli.py
index 1f29c7e..c91245d 100644
--- a/tools/cli.py
+++ b/tools/cli.py
@@ -68,7 +68,22 @@ if __name__ == "__main__":
                 for node in nodes:
                     print("  %3u    %-28s     %s            %s          %s" %  (node['id'], node['hostname'][:27], node['enabled'] and '✓' or 'x', node['verified'] and '✓' or 'x', node['fingerprint'][:28]))
                 
-            if 'verify' in cmd:
+            if 'unverify' in cmd:
+                nodeid = int(cmd.replace('unverify ', ''))
+                print("Unverifying node no. %u" % nodeid)
+                rv = requests.post('http://localhost:8000/api/node/modify',  headers = {
+                    'Cookie': cookie
+                    },
+                    json = {
+                        'id': nodeid,
+                        'verified': False
+                    }
+                    )
+                if rv.status_code == 200:
+                    print("Node successfully unverified!")
+                else:
+                    print(rv.text)
+            elif 'verify' in cmd:
                 nodeid = int(cmd.replace('verify ', ''))
                 print("Verifying node no. %u" % nodeid)
                 rv = requests.post('http://localhost:8000/api/node/modify',  headers = {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@warble.apache.org
For additional commands, e-mail: commits-help@warble.apache.org