change order to get the right username
This commit is contained in:
parent
aff40b21b0
commit
a95dfca22f
@ -54,11 +54,11 @@ def files(options):
|
|||||||
files = options.file.split(',')
|
files = options.file.split(',')
|
||||||
for file in files:
|
for file in files:
|
||||||
configfile = ConfigObj(file)
|
configfile = ConfigObj(file)
|
||||||
if configfile['setting']['use_zarafa_credentials']:
|
if configfile['setting'].as_bool('use_zarafa_credentials'):
|
||||||
username = configfile['setting']['default_user']
|
|
||||||
else:
|
|
||||||
username = options.user
|
username = options.user
|
||||||
password = encode(configfile['setting']['default_password'])
|
else:
|
||||||
|
username = configfile['setting'].get('default_user', 'does not matter')
|
||||||
|
password = encode(configfile['setting'].get('default_password', 'does not matter'))
|
||||||
backendoptions = {
|
backendoptions = {
|
||||||
'ftp': {"backend_features": {
|
'ftp': {"backend_features": {
|
||||||
"Streaming": "true", }},
|
"Streaming": "true", }},
|
||||||
@ -93,6 +93,7 @@ def files(options):
|
|||||||
address = configfile['setting']['server_address']
|
address = configfile['setting']['server_address']
|
||||||
ssl = configfile['setting']['server_ssl']
|
ssl = configfile['setting']['server_ssl']
|
||||||
id = str(uuid.uuid4())
|
id = str(uuid.uuid4())
|
||||||
|
|
||||||
filesjson['accounts'][id] = {
|
filesjson['accounts'][id] = {
|
||||||
"status": "ok",
|
"status": "ok",
|
||||||
"backend_config": {
|
"backend_config": {
|
||||||
@ -101,7 +102,7 @@ def files(options):
|
|||||||
"server_address": encode(address).decode('utf-8'),
|
"server_address": encode(address).decode('utf-8'),
|
||||||
"server_ssl": ssl,
|
"server_ssl": ssl,
|
||||||
"current_account_id": encode('d4cacda458a2a26c301f2b7d75ada530').decode('utf-8'),
|
"current_account_id": encode('d4cacda458a2a26c301f2b7d75ada530').decode('utf-8'),
|
||||||
"use_zarafa_credentials": configfile['setting']['use_zarafa_credentials'],
|
"use_zarafa_credentials": configfile['setting'].as_bool('use_zarafa_credentials'),
|
||||||
"user": encode(username).decode('utf-8'),
|
"user": encode(username).decode('utf-8'),
|
||||||
"password": password.decode('utf-8'),
|
"password": password.decode('utf-8'),
|
||||||
"server_port": encode(port).decode('utf-8')
|
"server_port": encode(port).decode('utf-8')
|
||||||
|
Loading…
Reference in New Issue
Block a user