1
0
mirror of https://github.com/dkmstr/openuds.git synced 2024-12-22 13:34:04 +03:00

Added config initialization on config command

This commit is contained in:
Adolfo Gómez García 2015-01-14 19:35:59 +01:00
parent e11867a55e
commit 9335c73003
2 changed files with 4 additions and 2 deletions

View File

@ -198,8 +198,9 @@ class Config(object):
cfg.value = value
cfg.save()
logger.debug('Updated value for {0}.{1} to {2}'.format(section, key, value))
return True
except Exception:
pass
return False
class GlobalConfig(object):

View File

@ -55,6 +55,7 @@ class Command(BaseCommand):
mod, name = first
else:
mod, name = GLOBAL_SECTION, first[0]
Config.update(mod, name, value)
if Config.update(mod, name, value) is False: # If not exists, try to store value without any special parameters
Config.section(mod).value(name, value).get()
except Exception:
logger.exception("Error")