mirror of
https://github.com/retspen/webvirtcloud
synced 2026-03-22 10:34:49 +00:00
black and isort lint.
This commit is contained in:
parent
77d031b04f
commit
7aaa018d2c
47 changed files with 1206 additions and 1063 deletions
|
|
@ -25,6 +25,9 @@ def nwfilters(request, compute_id):
|
|||
try:
|
||||
conn = wvmNWFilters(compute.hostname, compute.login, compute.password, compute.type)
|
||||
|
||||
for nwf in conn.get_nwfilters():
|
||||
nwfilters_all.append(conn.get_nwfilter_info(nwf))
|
||||
|
||||
if request.method == "POST":
|
||||
if "create_nwfilter" in request.POST:
|
||||
xml = request.POST.get("nwfilter_xml", "")
|
||||
|
|
@ -36,11 +39,11 @@ def nwfilters(request, compute_id):
|
|||
except util.etree.ParseError:
|
||||
name = None
|
||||
|
||||
for nwf in nwfilters:
|
||||
if name == nwf.name():
|
||||
for nwf in nwfilters_all:
|
||||
if name == nwf["name"]:
|
||||
error_msg = _("A network filter with this name already exists")
|
||||
raise Exception(error_msg)
|
||||
if uuid == nwf.UUIDString():
|
||||
if uuid == nwf["uuid"]:
|
||||
error_msg = _("A network filter with this UUID already exists")
|
||||
raise Exception(error_msg)
|
||||
else:
|
||||
|
|
@ -90,9 +93,6 @@ def nwfilters(request, compute_id):
|
|||
msg = _("Cloning NWFilter %(name)s as %(clone)s") % {"name":name, "clone": cln_name}
|
||||
addlogmsg(request.user.username, compute.hostname, msg)
|
||||
|
||||
for nwf in conn.get_nwfilters():
|
||||
nwfilters_all.append(conn.get_nwfilter_info(nwf))
|
||||
|
||||
conn.close()
|
||||
except libvirtError as lib_err:
|
||||
messages.error(request, lib_err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue