Exemple #1
0
    def __init__(self, env, create_updates):
        self.env = env
        self.create_updates = create_updates

        auth_inst = auth.Auth(api_url=GLOBOMAP_LOADER_API_URL,
                              username=GLOBOMAP_LOADER_API_USERNAME,
                              password=GLOBOMAP_LOADER_API_PASSWORD)
        self.update = Update(auth=auth_inst, driver_name='cloudstack')
Exemple #2
0
 def __init__(self):
     self.search = {'asorting_cols': ['-id']}
     self.client = NetworkAPI().client
     auth_inst = auth.Auth(
         api_url=settings.GLOBOMAP_LOADER_API_URL,
         username=settings.GLOBOMAP_LOADER_API_USERNAME,
         password=settings.GLOBOMAP_LOADER_API_PASSWORD
     )
     self.update = Update(auth=auth_inst, driver_name='napi')
def run():
    while True:
        inst = Napi()
        auth_inst = auth.Auth(api_url=settings.GLOBOMAP_LOADER_API_URL,
                              username=settings.GLOBOMAP_LOADER_API_USERNAME,
                              password=settings.GLOBOMAP_LOADER_API_PASSWORD)
        update = Update(auth=auth_inst, driver_name='napi')
        try:
            inst.process_updates(update.post)
        except Exception:
            LOGGER.exception('Error syncing updates from driver')
        finally:
            LOGGER.debug('No more updates found')
            LOGGER.debug('Sleeping for %ss' % 30)
            sleep(30)
Exemple #4
0
 def __init__(self):
     self.driver = Driver()
     auth_inst = auth.Auth(api_url=settings.GLOBOMAP_LOADER_API_URL,
                           username=settings.GLOBOMAP_LOADER_API_USERNAME,
                           password=settings.GLOBOMAP_LOADER_API_PASSWORD)
     Loader.update = Update(auth=auth_inst, driver_name='sample')