def test_file_config():
    from umit.icm.agent.utils import CreateConf
    CreateConf.create_file_conf("test.conf")
    config = FileConfig("test.conf")
    config.set("info", "name", "ABC")
    config.set("info", "age", '10')
    config.set("info", "rate", '3.3')
    raw_input()
    print(config.get("info", "name"))
    print(config.get("info", "age"))
    print(config.get("info", "rate"))
    os.remove("test.conf")
Beispiel #2
0
def test_file_config():
    from umit.icm.agent.utils import CreateConf
    CreateConf.create_file_conf("test.conf")
    config = FileConfig("test.conf")
    config.set("info", "name", "ABC")
    config.set("info", "age", '10')
    config.set("info", "rate", '3.3')
    raw_input()
    print(config.get("info", "name"))
    print(config.get("info", "age"))
    print(config.get("info", "rate"))
    os.remove("test.conf")
Beispiel #3
0
import os
import sys

from umit.icm.agent.BasePaths import *

#----------------------------------------------------------------------
from umit.icm.agent.config import FileConfig, DBConfig

useFileConf = True
if useFileConf:
    try:
        g_config = FileConfig(CONFIG_PATH)
    except IOError:
        from umit.icm.agent.utils import CreateConf
        CreateConf.create_file_conf(CONFIG_PATH)
        g_config = FileConfig(CONFIG_PATH)
else:
    try:
        g_config = DBConfig(DB_PATH)
    except IOError:
        from umit.icm.agent.utils import CreateConf
        CreateConf.create_db_conf(DB_PATH)
        g_config = DBConfig(DB_PATH)

#----------------------------------------------------------------------
from umit.icm.agent.db import DBHelper

#---------
DB_NAME = g_config.get("database", "name")
DB_PATH = os.path.join(DB_DIR, DB_NAME)
sys.path.insert(0, os.path.join(ROOT_DIR, 'deps', 'umit-common'))


#----------------------------------------------------------------------
from umit.icm.agent.Global import *
from umit.icm.agent.BasePaths import *
from umit.icm.agent.config import FileConfig, DBConfig

from umit.icm.agent.secure.Key import RSAKey
from umit.icm.agent.utils.CreateDB import create

try:
    g_config = DBConfig(DB_PATH)
except IOError:
    from umit.icm.agent.utils import CreateConf
    CreateConf.create_db_conf(DB_PATH)
    g_config = DBConfig(DB_PATH)


#ag_key = RSAKey()
#ag_key.construct()

mod = 93740173714873692520486809225128030132198461438147249362129501889664779512410440220785650833428588898698591424963196756217514115251721698086685512592960422731696162410024157767288910468830028582731342024445624992243984053669314926468760439060317134193339836267660799899385710848833751883032635625332235630111L
exp = 65537L

#print(ag_key.mod)
#print(ag_key.exp)
g_db_helper.set_value('keys','aggregator_public_key', (mod, exp))


import os
import sys

from umit.icm.agent.BasePaths import *

#----------------------------------------------------------------------
from umit.icm.agent.config import FileConfig, DBConfig

useFileConf = True
if useFileConf:
    try:
        g_config = FileConfig(CONFIG_PATH)
    except IOError:
        from umit.icm.agent.utils import CreateConf
        CreateConf.create_file_conf(CONFIG_PATH)
        g_config = FileConfig(CONFIG_PATH)
else:
    try:
        g_config = DBConfig(DB_PATH)
    except IOError:
        from umit.icm.agent.utils import CreateConf
        CreateConf.create_db_conf(DB_PATH)
        g_config = DBConfig(DB_PATH)

#----------------------------------------------------------------------
from umit.icm.agent.db import DBHelper

#---------
DB_NAME = g_config.get("database","name")
DB_PATH = os.path.join(DB_DIR,DB_NAME)
Beispiel #6
0
execfile(os.path.join(ROOT_DIR, 'deps', 'umit-common', 'utils', 'importer.py'))
sys.path.insert(0, ROOT_DIR)
sys.path.insert(0, os.path.join(ROOT_DIR, 'deps'))
sys.path.insert(0, os.path.join(ROOT_DIR, 'deps', 'icm-common'))
sys.path.insert(0, os.path.join(ROOT_DIR, 'deps', 'umit-common'))

#----------------------------------------------------------------------
from umit.icm.agent.Global import *
from umit.icm.agent.BasePaths import *
from umit.icm.agent.config import FileConfig, DBConfig

from umit.icm.agent.secure.Key import RSAKey
from umit.icm.agent.utils.CreateDB import create

try:
    g_config = DBConfig(DB_PATH)
except IOError:
    from umit.icm.agent.utils import CreateConf
    CreateConf.create_db_conf(DB_PATH)
    g_config = DBConfig(DB_PATH)

#ag_key = RSAKey()
#ag_key.construct()

mod = 93740173714873692520486809225128030132198461438147249362129501889664779512410440220785650833428588898698591424963196756217514115251721698086685512592960422731696162410024157767288910468830028582731342024445624992243984053669314926468760439060317134193339836267660799899385710848833751883032635625332235630111L
exp = 65537L

#print(ag_key.mod)
#print(ag_key.exp)
g_db_helper.set_value('keys', 'aggregator_public_key', (mod, exp))