diff --git a/.travis.yml b/.travis.yml index 75adc51..10e31c5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,4 @@ +--- language: python python: - "3.9" @@ -6,10 +7,11 @@ env: install: - pip install -r dev/requirements.txt script: - - pep8 --exclude=IPy.py --ignore=E501 vrtManager accounts admin appsettings computes \ - console create datasource instances interfaces \ - logs networks nwfilters storages virtsecrets - - pyflakes vrtManager accounts admin appsettings computes console create datasource instances interfaces \ - logs networks nwfilters storages virtsecrets + - pep8 --exclude=IPy.py --ignore=E501 vrtManager accounts admin appsettings \ + computesconsole create datasource instances \ + interfaceslogs 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 test --settings=webvirtcloud.settings-dev diff --git a/README.md b/README.md index 721a2d5..2027439 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ chmod 744 install.sh ### 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 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 ``` -#### Creating directories and cloning repo +#### Creating directories and cloning repository ```bash sudo mkdir /srv && cd /srv diff --git a/accounts/utils.py b/accounts/utils.py index 4507a54..fbbdf81 100644 --- a/accounts/utils.py +++ b/accounts/utils.py @@ -27,7 +27,7 @@ def validate_ssh_key(key): return False typeofkey = array[0] string = array[1] - username = array[2] + # must have only valid rsa-ssh key characters ie binascii characters try: data = base64.decodebytes(string) @@ -39,10 +39,9 @@ def validate_ssh_key(key): except struct.error: return False # data[4:str_len] must have string which matches with the typeofkey, another ssh key property. - if data[4 : 4 + str_len] == typeofkey: - return True - else: + if data[4 : 4 + str_len] != typeofkey: return False + return True def send_email_with_otp(user, device): diff --git a/instances/templates/allinstances_index_grouped.html b/instances/templates/allinstances_index_grouped.html index 5d270d4..604f81e 100644 --- a/instances/templates/allinstances_index_grouped.html +++ b/instances/templates/allinstances_index_grouped.html @@ -3,7 +3,7 @@ - + @@ -31,7 +31,7 @@ {% trans "Connected" %} {% if app_settings.VM_DRBD_STATUS == 'True' %} - + {% endif %} diff --git a/instances/templates/create_instance_w2.html b/instances/templates/create_instance_w2.html index 9c38670..f71328a 100644 --- a/instances/templates/create_instance_w2.html +++ b/instances/templates/create_instance_w2.html @@ -51,7 +51,7 @@ @@ -172,12 +172,12 @@
-
-
+
@@ -511,7 +511,7 @@
-
+
{% csrf_token %}
## {% trans "Name" %}
{% trans "Description" %}
{% trans "User"%} {% trans "Status" %} {{ compute.cpu_count }} {{ compute.ram_size|filesizeformat }}