Exemplo n.º 1
0
def provision():
    # TODO: Handle the case with an already existing vessel (See also system-provision)
    provisionList([systemvessel], objectmodels['vessel'])

    sysconfig = objectmodels['systemconfig'].find_one({'active': True})
    hfoslog('Adapting system config for default vessel:', sysconfig)
    sysconfig.vesseluuid = systemvessel['uuid']
    sysconfig.save()

    hfoslog('Provisioning: Vessel: Done.', emitter='PROVISIONS')
Exemplo n.º 2
0
def provision(**kwargs):
    # TODO: Handle the case with an already existing vessel (See also
    # system-provision)
    provisionList([systemvessel], objectmodels['vessel'], **kwargs)

    sysconfig = objectmodels['systemconfig'].find_one({'active': True})
    hfoslog('Adapting system config for default vessel:', sysconfig)
    sysconfig.vesseluuid = systemvessel['uuid']
    sysconfig.save()

    hfoslog('Provisioning: Vessel: Done.', emitter='PROVISIONS')
Exemplo n.º 3
0
def provision():
    currentconfig = objectmodels['systemconfig'].find_one({'active': True})

    if currentconfig is None:
        provisionList([systemconfig], objectmodels['systemconfig'])
        hfoslog('Provisioning: System: Done.', emitter='PROVISIONS')
    else:
        from pprint import pprint
        pprint(currentconfig)
        hfoslog('NOT provisioning system configuration, as there is an active configuration in the database.\n'
                'Please manually delete the mongo collection, until an override has been implemented.')
Exemplo n.º 4
0
Arquivo: system.py Projeto: ri0t/hfos
def provision(*args, **kwargs):
    clear = kwargs.get('clear', False)
    overwrite = kwargs.get('overwrite', False)

    default_system_config_count = objectmodels['systemconfig'].count({
        'name': 'Default System Configuration'})

    if default_system_config_count == 0 or (clear or overwrite):
        provisionList([systemconfig], objectmodels['systemconfig'], *args,
                      **kwargs)
        hfoslog('Provisioning: System: Done.', emitter='PROVISIONS')
    else:
        hfoslog('Default system configuration already present.', lvl=warn,
                emitter='PROVISIONS')
Exemplo n.º 5
0
def provision(*args, **kwargs):
    clear = kwargs.get('clear', False)
    overwrite = kwargs.get('overwrite', False)

    default_system_config_count = objectmodels['systemconfig'].count(
        {'name': 'Default System Configuration'})

    if default_system_config_count == 0 or (clear or overwrite):
        provisionList([systemconfig], objectmodels['systemconfig'], *args,
                      **kwargs)
        hfoslog('Provisioning: System: Done.', emitter='PROVISIONS')
    else:
        hfoslog('Default system configuration already present.',
                lvl=warn,
                emitter='PROVISIONS')
Exemplo n.º 6
0
Arquivo: user.py Projeto: ri0t/hfos
def provision(**kwargs):
    # TODO: Add a root user and make sure owner can access it later.
    # Setting up details and asking for a password here is not very useful,
    # since this process is usually run automated.

    if kwargs.get('overwrite', False):
        hfoslog('Refusing to overwrite system user!', lvl=warn,
                emitter='PROVISIONS')
        kwargs['overwrite'] = False

    system_user_count = objectmodels['user'].count({'name': 'System'})
    if system_user_count == 0 or kwargs.get('clear', False):
        provisionList(Users, objectmodels['user'], **kwargs)
        hfoslog('Provisioning: Users: Done.', emitter="PROVISIONS")
    else:
        hfoslog('System user already present.', lvl=warn, emitter='PROVISIONS')
Exemplo n.º 7
0
def provision(**kwargs):
    # TODO: Add a root user and make sure owner can access it later.
    # Setting up details and asking for a password here is not very useful,
    # since this process is usually run automated.

    if kwargs.get('overwrite', False):
        hfoslog('Refusing to overwrite system user!',
                lvl=warn,
                emitter='PROVISIONS')
        kwargs['overwrite'] = False

    system_user_count = objectmodels['user'].count({'name': 'System'})
    if system_user_count == 0 or kwargs.get('clear', False):
        provisionList(Users, objectmodels['user'], **kwargs)
        hfoslog('Provisioning: Users: Done.', emitter="PROVISIONS")
    else:
        hfoslog('System user already present.', lvl=warn, emitter='PROVISIONS')
Exemplo n.º 8
0
def provision():
    sentences = {}
    sentences.update(getNMEASentences())
    sentences.update(getProprietarySentences())

    # pprint(sentences)

    fields = getFields(sentences)

    # pprint(fields)

    sensordatatypes = getSensorData(fields, sentences)

    # pprint(sensordatatypes)

    provisionitems = []

    # datatypes = {
    #    'string': [],
    #    'number': [],
    #    'integer': [],
    #    'unknown': []
    # }

    for datatype in sensordatatypes.values():
        provisionitems.append(datatype)
        # datatypes[datatype['type']].append(datatype['description'])

        # pprint(provisionitems)
        # print(len(provisionitems))

        # pprint(datatypes)

        # for name, typeitems in datatypes.items():
        #    print('%s has %i elements' % (name, len(typeitems)))

    provisionList(provisionitems, objectmodels['sensordatatype'], clear=True)
    hfoslog('Provisioning: Sensordatatypes: Done.', emitter='PROVISIONS')
Exemplo n.º 9
0
def provision(**kwargs):
    sentences = {}
    sentences.update(getNMEASentences())
    sentences.update(getProprietarySentences())

    # pprint(sentences)

    fields = getFields(sentences)

    # pprint(fields)

    sensordatatypes = getSensorData(fields, sentences)

    # pprint(sensordatatypes)

    provisionitems = []

    # datatypes = {
    #    'string': [],
    #    'number': [],
    #    'integer': [],
    #    'unknown': []
    # }

    for datatype in sensordatatypes.values():
        provisionitems.append(datatype)
        # datatypes[datatype['type']].append(datatype['description'])

        # pprint(provisionitems)
        # print(len(provisionitems))

        # pprint(datatypes)

        # for name, typeitems in datatypes.items():
        #    print('%s has %i elements' % (name, len(typeitems)))

    provisionList(provisionitems, objectmodels['sensordatatype'], **kwargs)
    hfoslog('Provisioning: Sensordatatypes: Done.', emitter='PROVISIONS')
Exemplo n.º 10
0
def provision():
    provisionList(Mapviews, objectmodels['mapview'], indexes=['name'],
                  clear=True)
    hfoslog('Provisioning: Mapviews: Done.', emitter='PROVISIONS')
Exemplo n.º 11
0
def provision():
    # TODO: Add a root user and make sure owner can access it later.
    # Setting up details and asking for a password here is not very useful, since this process is usually run automated.

    provisionList(Users, objectmodels['user'], indexes=['name'], clear=False)
    hfoslog('Provisioning: Users: Done.', emitter="PROVISIONS")
Exemplo n.º 12
0
def provision(**kwargs):
    provisionList(layers, objectmodels['layer'], **kwargs)
    hfoslog('Provisioning: Layers: Done.', emitter='PROVISIONS')
Exemplo n.º 13
0
Arquivo: project.py Projeto: ri0t/hfos
def provision(**kwargs):
    provisionList(Projects, projectobject, indices=['name'], **kwargs)
    hfoslog('[PROV] Provisioning: Project: Done.')
Exemplo n.º 14
0
def provision():
    provisionList(CrewConfig, objectmodels['crewconfig'])
    hfoslog('[PROV] Provisioning: Crewconfigs: Done.')
Exemplo n.º 15
0
def provision(**kwargs):
    provisionList(Dashboards, objectmodels['dashboardconfig'], **kwargs)
    hfoslog('[PROV] Provisioning: Dashboards: Done.')
Exemplo n.º 16
0
def provision():
    provisionList(Projects, projectobject, indexes=['name'], clear=True)
    hfoslog('[PROV] Provisioning: Project: Done.')
Exemplo n.º 17
0
def provision():
    provisionList(layers, layerobject, overwrite=True, clear=True)
    hfoslog('[PROV] Provisioning: Layers: Done.')
Exemplo n.º 18
0
def provision():
    provisionList(layergroups, objectmodels['layergroup'], overwrite=True,
                  clear=True)
    hfoslog('Provisioning: Layergroups: Done.', emitter='PROVISIONS')
Exemplo n.º 19
0
def provision(**kwargs):
    provisionList(meshnodes, objectmodels['meshnode'], **kwargs)
    hfoslog('Provisioning: Meshnodes: Done.', emitter='PROVISIONS')
Exemplo n.º 20
0
def provision():
    provisionList(layers, layerobject, overwrite=True, clear=True)
    hfoslog('[PROV] Provisioning: Layers: Done.')
Exemplo n.º 21
0
def provision(**kwargs):
    provisionList(CrewConfig, objectmodels['crewconfig'], **kwargs)
    hfoslog('[PROV] Provisioning: Crewconfigs: Done.')
Exemplo n.º 22
0
def provision(**kwargs):
    provisionList(Logbooks, objectmodels['logbookconfig'], **kwargs)
    hfoslog('[PROV] Provisioning: Logbooks: Done.')
Exemplo n.º 23
0
def provision():
    provisionList(Logbooks, objectmodels['logbookconfig'])
    hfoslog('[PROV] Provisioning: Logbooks: Done.')
Exemplo n.º 24
0
def provisionPages():
    provisionList(WikiPages, objectmodels['wikipage'])
    hfoslog('WikiPages: Done.', emitter='PROVISIONING')
Exemplo n.º 25
0
def provision(**kwargs):
    provisionList(Calcs, objectmodels['calcconfig'], **kwargs)
    hfoslog('[PROV] Provisioning: Calcs: Done.')
Exemplo n.º 26
0
def provisionTemplates():
    provisionList(WikiTemplates, objectmodels['wikitemplate'])
    hfoslog('WikiTemplates: Done.', emitter='PROVISIONING')
Exemplo n.º 27
0
Arquivo: wiki.py Projeto: ri0t/hfos
def provisionTemplates(**kwargs):
    provisionList(WikiTemplates, objectmodels['wikitemplate'], **kwargs)
    hfoslog('WikiTemplates: Done.', emitter='PROVISIONING')
Exemplo n.º 28
0
def provision():
    provisionList(WikiPages, wikipageobject)
    hfoslog('[PROV] Provisioning: WikiPages: Done.')
Exemplo n.º 29
0
Arquivo: mapview.py Projeto: ri0t/hfos
def provision(**kwargs):
    provisionList(Mapviews,
                  objectmodels['mapview'],
                  indices=['name'],
                  **kwargs)
    hfoslog('Provisioning: Mapviews: Done.', emitter='PROVISIONS')
Exemplo n.º 30
0
def provision(*args, **kwargs):
    provisionList(Automata, objectmodels['automatrule'], **kwargs)
    hfoslog('[PROV] Provisioning: Automata: Done.')
Exemplo n.º 31
0
def provision(**kwargs):
    provisionList(Controllers, controllerobject, **kwargs)
    hfoslog('[PROV] Provisioning: Controllers: Done.')
Exemplo n.º 32
0
def provision():
    provisionList(Controllables, controllableobject)
    hfoslog('[PROV] Provisioning: Controllables: Done.')
Exemplo n.º 33
0
def provision():
    provisionList(WikiPages, wikipageobject)
    hfoslog("[PROV] Provisioning: WikiPages: Done.")
Exemplo n.º 34
0
Arquivo: wiki.py Projeto: ri0t/hfos
def provisionPages(**kwargs):
    provisionList(WikiPages, objectmodels['wikipage'], **kwargs)
    hfoslog('WikiPages: Done.', emitter='PROVISIONING')
Exemplo n.º 35
0
def provision():
    provisionList(Dashboards, dashboardobject)
    hfoslog('[PROV] Provisioning: Dashboards: Done.')
Exemplo n.º 36
0
def provision():
    provisionList(Dashboards, objectmodels['dashboardconfig'])
    hfoslog('[PROV] Provisioning: Dashboards: Done.')
Exemplo n.º 37
0
def provision(*args, **kwargs):
    provisionList(Automata, objectmodels['automatrule'], **kwargs)
    hfoslog('[PROV] Provisioning: Automata: Done.')