Skip to content

Commit

Permalink
adding debug
Browse files Browse the repository at this point in the history
  • Loading branch information
chadfurman committed May 4, 2024
1 parent 1795f8a commit f59b91c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion management/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ def mgmt(cmd, data=None, is_json=False):
# The base URL for the management daemon. (Listens on IPv4 only.)
mgmt_uri = 'http://127.0.0.1:10222'

print('Got here, mgmt_uri:', mgmt_uri)
setup_key_auth(mgmt_uri)

print('Got here, cmd:', cmd)
req = urllib.request.Request(mgmt_uri + cmd, urllib.parse.urlencode(data).encode("utf8") if data else None)
try:
response = urllib.request.urlopen(req)
Expand All @@ -30,6 +32,7 @@ def mgmt(cmd, data=None, is_json=False):
sys.exit(1)
resp = response.read().decode('utf8')
if is_json: resp = json.loads(resp)
print(resp)
return resp

def read_password():
Expand Down Expand Up @@ -161,4 +164,3 @@ def setup_key_auth(mgmt_uri):
else:
print("Invalid command-line arguments.")
sys.exit(1)

1 change: 1 addition & 0 deletions management/daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ def mail_users():
@app.route('/mail/users/add', methods=['POST'])
@authorized_personnel_only
def mail_users_add():
print('got here, adding user, request.form:', request.form)
quota = request.form.get('quota', get_default_quota(env))
try:
return add_mail_user(request.form.get('email', ''), request.form.get('password', ''), request.form.get('privileges', ''), quota, env)
Expand Down

0 comments on commit f59b91c

Please sign in to comment.