mirror of
https://github.com/retspen/webvirtcloud
synced 2024-12-25 23:55:24 +00:00
fix linter warnings/error
This commit is contained in:
parent
aeee56fe45
commit
afffaa8589
5 changed files with 18 additions and 17 deletions
12
.travis.yml
12
.travis.yml
|
@ -1,3 +1,4 @@
|
||||||
|
---
|
||||||
language: python
|
language: python
|
||||||
python:
|
python:
|
||||||
- "3.9"
|
- "3.9"
|
||||||
|
@ -6,10 +7,11 @@ env:
|
||||||
install:
|
install:
|
||||||
- pip install -r dev/requirements.txt
|
- pip install -r dev/requirements.txt
|
||||||
script:
|
script:
|
||||||
- pep8 --exclude=IPy.py --ignore=E501 vrtManager accounts admin appsettings computes \
|
- pep8 --exclude=IPy.py --ignore=E501 vrtManager accounts admin appsettings \
|
||||||
console create datasource instances interfaces \
|
computesconsole create datasource instances \
|
||||||
logs networks nwfilters storages virtsecrets
|
interfaceslogs networks nwfilters storages \
|
||||||
- pyflakes vrtManager accounts admin appsettings computes console create datasource instances interfaces \
|
virtsecrets
|
||||||
logs networks nwfilters storages virtsecrets
|
- pyflakes vrtManager accounts admin appsettings computes console create datasource \
|
||||||
|
instances interfaces logs networks nwfilters storages virtsecrets
|
||||||
- python manage.py migrate
|
- python manage.py migrate
|
||||||
- python manage.py test --settings=webvirtcloud.settings-dev
|
- python manage.py test --settings=webvirtcloud.settings-dev
|
||||||
|
|
|
@ -46,7 +46,7 @@ chmod 744 install.sh
|
||||||
|
|
||||||
### Generate secret key
|
### Generate secret key
|
||||||
|
|
||||||
You should generate SECRET_KEY after cloning repo. Then put it into webvirtcloud/settings.py.
|
You should generate SECRET_KEY after cloning repository. Then put it into webvirtcloud/settings.py.
|
||||||
|
|
||||||
```python3
|
```python3
|
||||||
import random, string
|
import random, string
|
||||||
|
@ -101,7 +101,7 @@ sudo yum -y install epel-release
|
||||||
sudo yum -y install python3-virtualenv python3-devel libvirt-devel glibc gcc nginx supervisor python3-lxml git python3-libguestfs iproute-tc cyrus-sasl-md5 python3-libguestfs libsasl2-dev libldap2-dev libssl-dev
|
sudo yum -y install python3-virtualenv python3-devel libvirt-devel glibc gcc nginx supervisor python3-lxml git python3-libguestfs iproute-tc cyrus-sasl-md5 python3-libguestfs libsasl2-dev libldap2-dev libssl-dev
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Creating directories and cloning repo
|
#### Creating directories and cloning repository
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo mkdir /srv && cd /srv
|
sudo mkdir /srv && cd /srv
|
||||||
|
|
|
@ -27,7 +27,7 @@ def validate_ssh_key(key):
|
||||||
return False
|
return False
|
||||||
typeofkey = array[0]
|
typeofkey = array[0]
|
||||||
string = array[1]
|
string = array[1]
|
||||||
username = array[2]
|
|
||||||
# must have only valid rsa-ssh key characters ie binascii characters
|
# must have only valid rsa-ssh key characters ie binascii characters
|
||||||
try:
|
try:
|
||||||
data = base64.decodebytes(string)
|
data = base64.decodebytes(string)
|
||||||
|
@ -39,10 +39,9 @@ def validate_ssh_key(key):
|
||||||
except struct.error:
|
except struct.error:
|
||||||
return False
|
return False
|
||||||
# data[4:str_len] must have string which matches with the typeofkey, another ssh key property.
|
# data[4:str_len] must have string which matches with the typeofkey, another ssh key property.
|
||||||
if data[4 : 4 + str_len] == typeofkey:
|
if data[4 : 4 + str_len] != typeofkey:
|
||||||
return True
|
|
||||||
else:
|
|
||||||
return False
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
def send_email_with_otp(user, device):
|
def send_email_with_otp(user, device):
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<table class="table table-hover sortable-theme-bootstrap" data-sortable>
|
<table class="table table-hover sortable-theme-bootstrap" data-sortable>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="col" data-sortable="false"><a class="link-primary" href="#" id="hide_all_instances" onclick="hide_all_host_instances()">#</a></th>
|
<th scope="col" data-sortable="false"><a class="link-primary" href="#" id="hide-all-instances" onclick="hide_all_host_instances()">#</a></th>
|
||||||
<th scope="col">{% trans "Name" %}<br>{% trans "Description" %}</th>
|
<th scope="col">{% trans "Name" %}<br>{% trans "Description" %}</th>
|
||||||
<th scope="col" class="d-none d-sm-table-cell">{% trans "User"%}</th>
|
<th scope="col" class="d-none d-sm-table-cell">{% trans "User"%}</th>
|
||||||
<th scope="col">{% trans "Status" %}</th>
|
<th scope="col">{% trans "Status" %}</th>
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item" role="presentation">
|
<li class="nav-item" role="presentation">
|
||||||
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#addFromTemp" type="button" role="tab" aria-controls="addFromTemp" aria-selected="false">
|
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#add-from-temp" type="button" role="tab" aria-controls="add-from-temp" aria-selected="false">
|
||||||
{% trans "Template" %}
|
{% trans "Template" %}
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
|
@ -172,12 +172,12 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<label class="col-sm-4 col-form-label">{% trans "Advanced" %}</label>
|
<label class="col-sm-4 col-form-label">{% trans "Advanced" %}</label>
|
||||||
<div class="d-grid col-sm-7">
|
<div class="d-grid col-sm-7">
|
||||||
<button class="btn btn-outline-light" type="button" data-bs-toggle="collapse" data-bs-target="#flavAddCollapse" aria-expanded="false" aria-controls="flavAddCollapse">
|
<button class="btn btn-outline-light" type="button" data-bs-toggle="collapse" data-bs-target="#flav-add-collapse" aria-expanded="false" aria-controls="flav-add-collapse">
|
||||||
<span class="fa fa-caret-down"></span>
|
<span class="fa fa-caret-down"></span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="collapse" id="flavAddCollapse">
|
<div class="collapse" id="flav-add-collapse">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<label class="col-sm-4 col-form-label">{% trans "MAC" %}</label>
|
<label class="col-sm-4 col-form-label">{% trans "MAC" %}</label>
|
||||||
<div class="col-sm-7">
|
<div class="col-sm-7">
|
||||||
|
@ -511,7 +511,7 @@
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div role="tabpanel" class="tab-pane tab-pane-bordered" id="addFromTemp">
|
<div role="tabpanel" class="tab-pane tab-pane-bordered" id="add-from-temp">
|
||||||
<div>
|
<div>
|
||||||
<form method="post" role="form" aria-label="Create instance from template form">{% csrf_token %}
|
<form method="post" role="form" aria-label="Create instance from template form">{% csrf_token %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
Loading…
Reference in a new issue