[entropy.const] make possible to enable entropy.server community repositories mode by setting ETP_COMMUNITY_MODE

This commit is contained in:
Fabio Erculiani
2011-01-28 19:26:50 +01:00
parent 1339af7022
commit c4a1fc398b
+6 -1
View File
@@ -208,6 +208,11 @@ def const_default_settings(rootdir):
with open(cmdline_file, "r") as cmdline_f:
cmdline = cmdline_f.readline().strip().split()
def _default_community_repo_mode():
if os.getuid() != 0:
return False
return os.getenv("ETP_COMMUNITY_MODE", False)
etpConst.clear()
my_const = {
'logging': {
@@ -216,7 +221,7 @@ def const_default_settings(rootdir):
},
'server_repositories': {},
'community': {
'mode': False,
'mode': _default_community_repo_mode(),
},
'cmdline': cmdline,
'backed_up': {},