Skip to content

Commit

Permalink
add server base url in default conf
Browse files Browse the repository at this point in the history
Signed-off-by: rdotjain <[email protected]>
  • Loading branch information
rdotjain committed Jul 29, 2022
1 parent b9108b7 commit fbf85f1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
1 change: 1 addition & 0 deletions zezere/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ debug = no
allowed_hosts = localhost, localhost.localdomain
secure_cookie = yes
# auth_method = local, oidc
# ov_base_url =

[oidc.rp]
# client_id =
Expand Down
14 changes: 8 additions & 6 deletions zezere/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,11 @@
]

MESSAGE_TAGS = {
messages.DEBUG: 'alert-secondary',
messages.INFO: 'alert-info',
messages.SUCCESS: 'alert-success',
messages.WARNING: 'alert-warning',
messages.ERROR: 'alert-danger',
}
messages.DEBUG: "alert-secondary",
messages.INFO: "alert-info",
messages.SUCCESS: "alert-success",
messages.WARNING: "alert-warning",
messages.ERROR: "alert-danger",
}

OV_BASE_URL = get("global", "ov_base_url", "OV_BASE_URL")
5 changes: 3 additions & 2 deletions zezere/views_portal.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from ipware import get_client_ip

from zezere.models import Device, RunRequest, device_getter, SSHKey
from zezere.settings import OV_BASE_URL


@login_required
Expand Down Expand Up @@ -141,13 +142,13 @@ def add_ov(request):
messages.error(request, "No ownership voucher provided")
return redirect("portal_ov")

url = "http://localhost:8081/management/v1/ownership_voucher"
url = OV_BASE_URL
headers = {
"X-Number-Of-Vouchers": no_of_vouchers,
"Content-Type": content_type,
"Authorization": "Bearer",
}

try:
response = requests.request("POST", url, headers=headers, data=payload)
except requests.exceptions.RequestException as e:
Expand Down

0 comments on commit fbf85f1

Please sign in to comment.