mirror of
https://github.com/GNS3/gns3-server.git
synced 2024-11-17 01:04:51 +02:00
Support null in compute user and password
This commit is contained in:
parent
314a7cd8fb
commit
84b12fd953
@ -72,12 +72,14 @@ class Compute:
|
|||||||
"""
|
"""
|
||||||
Set authentication parameters
|
Set authentication parameters
|
||||||
"""
|
"""
|
||||||
self._user = user
|
if user is None or len(user.strip()) == 0:
|
||||||
self._password = password
|
self._user = None
|
||||||
if self._user and self._password:
|
self._password = None
|
||||||
self._auth = aiohttp.BasicAuth(self._user, self._password)
|
|
||||||
else:
|
|
||||||
self._auth = None
|
self._auth = None
|
||||||
|
else:
|
||||||
|
self._user = user.strip()
|
||||||
|
self._password = password.strip()
|
||||||
|
self._auth = aiohttp.BasicAuth(self._user, self._password)
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def update(self, **kwargs):
|
def update(self, **kwargs):
|
||||||
|
@ -43,11 +43,11 @@ COMPUTE_CREATE_SCHEMA = {
|
|||||||
},
|
},
|
||||||
"user": {
|
"user": {
|
||||||
"description": "User for authentication",
|
"description": "User for authentication",
|
||||||
"type": "string"
|
"type": ["string", "null"]
|
||||||
},
|
},
|
||||||
"password": {
|
"password": {
|
||||||
"description": "Password for authentication",
|
"description": "Password for authentication",
|
||||||
"type": "string"
|
"type": ["string", "null"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": False,
|
"additionalProperties": False,
|
||||||
@ -84,7 +84,7 @@ COMPUTE_OBJECT_SCHEMA = {
|
|||||||
},
|
},
|
||||||
"user": {
|
"user": {
|
||||||
"description": "User for authentication",
|
"description": "User for authentication",
|
||||||
"type": "string"
|
"type": ["string", "null"]
|
||||||
},
|
},
|
||||||
"connected": {
|
"connected": {
|
||||||
"description": "Whether the controller is connected to the compute server or not",
|
"description": "Whether the controller is connected to the compute server or not",
|
||||||
|
Loading…
Reference in New Issue
Block a user