def setUpClass(cls):
     if not os.path.exists(cls.TMP_ROOT):
         os.makedirs(cls.TMP_ROOT)
     path = os.path.join(
         os.path.abspath(os.path.dirname(__file__)),
         'data',
         'pulp.conf')
     pulp_conf.read(path)
Beispiel #2
0
 def setUpClass(cls):
     if not os.path.exists(cls.TMP_ROOT):
         os.makedirs(cls.TMP_ROOT)
     stop_logging()
     path = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'data',
                         'pulp.conf')
     pulp_conf.read(path)
     start_logging()
     storage_dir = pulp_conf.get('server', 'storage_dir')
     if not os.path.exists(storage_dir):
         os.makedirs(storage_dir)
     shutil.rmtree(storage_dir + '/*', ignore_errors=True)
     name = pulp_conf.get('database', 'name')
     connection.initialize(name)
     managers.initialize()
Beispiel #3
0
    def setUpClass(cls):
        # This will make Celery tasks run synchronously
        celery_instance.celery.conf.CELERY_ALWAYS_EAGER = True

        if not os.path.exists(cls.TMP_ROOT):
            os.makedirs(cls.TMP_ROOT)
        stop_logging()
        path = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'data',
                            'pulp.conf')
        pulp_conf.read(path)
        start_logging()
        storage_dir = pulp_conf.get('server', 'storage_dir')
        if not os.path.exists(storage_dir):
            os.makedirs(storage_dir)
        shutil.rmtree(storage_dir + '/*', ignore_errors=True)
        managers.initialize()
Beispiel #4
0
 def setUpClass(cls):
     if not os.path.exists(cls.TMP_ROOT):
         os.makedirs(cls.TMP_ROOT)
     stop_logging()
     path = os.path.join(
         os.path.abspath(os.path.dirname(__file__)),
         'data',
         'pulp.conf')
     pulp_conf.read(path)
     start_logging()
     storage_dir = pulp_conf.get('server', 'storage_dir')
     if not os.path.exists(storage_dir):
         os.makedirs(storage_dir)
     shutil.rmtree(storage_dir+'/*', ignore_errors=True)
     name = pulp_conf.get('database', 'name')
     connection.initialize(name)
     managers.initialize()
Beispiel #5
0
    def setUpClass(cls):
        # This will make Celery tasks run synchronously
        celery_instance.celery.conf.CELERY_ALWAYS_EAGER = True

        if not os.path.exists(cls.TMP_ROOT):
            os.makedirs(cls.TMP_ROOT)
        stop_logging()
        path = os.path.join(
            os.path.abspath(os.path.dirname(__file__)),
            'data',
            'pulp.conf')
        pulp_conf.read(path)
        start_logging()
        storage_dir = pulp_conf.get('server', 'storage_dir')
        if not os.path.exists(storage_dir):
            os.makedirs(storage_dir)
        shutil.rmtree(storage_dir+'/*', ignore_errors=True)
        managers.initialize()
Beispiel #6
0
    def setUpClass(cls):
        # This will make Celery tasks run synchronously
        celery_instance.celery.conf.CELERY_ALWAYS_EAGER = True
        cls.reserve_resources_patch = mock.patch(
            'pulp.server.async.tasks._reserve_resource.'
            'apply_async')
        mock_patch = cls.reserve_resources_patch.start()
        mock_patch.return_value.get.return_value = 'some_queue'

        if not os.path.exists(cls.TMP_ROOT):
            os.makedirs(cls.TMP_ROOT)
        stop_logging()
        path = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'data',
                            'pulp.conf')
        pulp_conf.read(path)
        start_logging()
        storage_dir = pulp_conf.get('server', 'storage_dir')
        if not os.path.exists(storage_dir):
            os.makedirs(storage_dir)
        shutil.rmtree(storage_dir + '/*', ignore_errors=True)
        name = pulp_conf.get('database', 'name')
        connection.initialize(name)
        managers.initialize()
Beispiel #7
0
    def setUpClass(cls):
        # This will make Celery tasks run synchronously
        celery_instance.celery.conf.CELERY_ALWAYS_EAGER = True
        cls.reserve_resources_patch = mock.patch('pulp.server.async.tasks._reserve_resource.'
                                                 'apply_async')
        mock_patch = cls.reserve_resources_patch.start()
        mock_patch.return_value.get.return_value = 'some_queue'

        if not os.path.exists(cls.TMP_ROOT):
            os.makedirs(cls.TMP_ROOT)
        stop_logging()
        path = os.path.join(
            os.path.abspath(os.path.dirname(__file__)),
            'data',
            'pulp.conf')
        pulp_conf.read(path)
        start_logging()
        storage_dir = pulp_conf.get('server', 'storage_dir')
        if not os.path.exists(storage_dir):
            os.makedirs(storage_dir)
        shutil.rmtree(storage_dir+'/*', ignore_errors=True)
        name = pulp_conf.get('database', 'name')
        connection.initialize(name)
        managers.initialize()
 def setUpClass(cls):
     if not os.path.exists(cls.TMP_ROOT):
         os.makedirs(cls.TMP_ROOT)
     path = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'data',
                         'pulp.conf')
     pulp_conf.read(path)
 def setUpClass(cls):
     path = os.path.join(
         os.path.abspath(os.path.dirname(__file__)),
         'data',
         'pulp.conf')
     pulp_conf.read(path)
 def setUpClass(cls):
     path = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'data',
                         'pulp.conf')
     pulp_conf.read(path)