Actions
Issue #1242
closedDjango setting undefined error in importer update
Status:
CLOSED - DUPLICATE
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
2.7.0 Beta
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:
Description
Running the automation
def test_04_importer_update(self):
response = self.importer.update(self.pulp, data={"importer_config": {"num_units": 10}})
Task.wait_for_report(self.pulp, response)
self.importer.reload(self.pulp)
self.assertEqual(self.importer.data["config"]["num_units"], 10)
See the following error
Task failed: {u'code': u'PLP0000', u'data': {}, u'description': u'Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.', u'sub_errors': []}: {u'exception': None, u'task_type': u'pulp.server.managers.repo.importer.update_importer_config', u'_href': u'/pulp/api/v2/tasks/5b037765-fde9-415d-9510-244a20bd723c/', u'task_id': u'5b037765-fde9-415d-9510-244a20bd723c', u'tags': [u'pulp:repository:zoo', u'pulp:repository_importer:yum_importer', u'pulp:action:update_importer'], u'finish_time': u'2015-09-03T00:02:55Z', u'_ns': u'task_status', u'start_time': u'2015-09-03T00:02:55Z', u'traceback': u'Traceback (most recent call last):\n File "/usr/lib/python2.6/site-packages/celery/app/trace.py", line 240, in trace_task\n R = retval = fun(*args, **kwargs)\n File "/usr/lib/python2.6/site-packages/pulp/server/async/tasks.py", line 394, in __call__\n return super(Task, self).__call__(*args, **kwargs)\n File "/usr/lib/python2.6/site-packages/celery/app/trace.py", line 437, in __protected_call__\n return self.run(*args, **kwargs)\n File "/usr/lib/python2.6/site-packages/pulp/server/managers/repo/importer.py", line 300, in update_importer_config\n return serializer.data\n File "/usr/lib/python2.6/site-packages/pulp/server/webservices/views/serializers/__init__.py", line 128, in data\n return self._to_representation(self.instance)\n File "/usr/lib/python2.6/site-packages/pulp/server/webservices/views/serializers/__init__.py", line 76, in _to_representation\n href = self.get_href(instance)\n File "/usr/lib/python2.6/site-packages/pulp/server/webservices/views/serializers/__init__.py", line 172, in get_href\n \'importer_id\': instance[\'id\']})\n File "/usr/lib/python2.6/site-packages/django/core/urlresolvers.py", line 451, in reverse\n resolver = get_resolver(urlconf)\n File "/usr/lib/python2.6/site-packages/django/utils/functional.py", line 27, in wrapper\n result = func(*args)\n File "/usr/lib/python2.6/site-packages/django/core/urlresolvers.py", line 118, in get_resolver\n urlconf = settings.ROOT_URLCONF\n File "/usr/lib/python2.6/site-packages/django/utils/functional.py", line 184, in inner\n self._setup()\n File "/usr/lib/python2.6/site-packages/django/conf/__init__.py", line 40, in _setup\n raise ImportError("Settings cannot be imported, because environment variable %s is undefined." % ENVIRONMENT_VARIABLE)\nImportError: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.\n', u'spawned_tasks': [], u'progress_report': {}, u'queue': u'reserved_resource_worker-1@ec2-54-78-144-90.eu-west-1.compute.amazonaws.com.dq', u'state': u'error', u'worker_name': u'reserved_resource_worker-1@ec2-54-78-144-90.eu-west-1.compute.amazonaws.com', u'result': None, u'error': {u'code': u'PLP0000', u'data': {}, u'description': u'Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.', u'sub_errors': []}, u'_id': {u'$oid': u'55e78e2f67cb7dd0e1de401a'}, u'id': u'55e78e2f67cb7dd0e1de401a'}
-------------------- >> begin captured logging << --------------------
requests.packages.urllib3.connectionpool: INFO: Resetting dropped connection: ec2-54-78-144-90.eu-west-1.compute.amazonaws.com
requests.packages.urllib3.connectionpool: DEBUG: "PUT /pulp/api/v2/repositories/zoo/importers/yum_importer/ HTTP/1.1" 202 172
pulp_auto.pulp: DEBUG: .send(Request('PUT', u'/repositories/zoo/importers/yum_importer/', data='{"importer_config": {"num_units": 10}}', headers={'content-type': 'application/json'})) ==
requests.packages.urllib3.connectionpool: INFO: Resetting dropped connection: ec2-54-78-144-90.eu-west-1.compute.amazonaws.com
requests.packages.urllib3.connectionpool: DEBUG: "GET /pulp/api/v2/tasks/5b037765-fde9-415d-9510-244a20bd723c/ HTTP/1.1" 200 2868
pulp_auto.pulp: DEBUG: .send(Request('GET', u'/tasks/5b037765-fde9-415d-9510-244a20bd723c/', data='{}', headers={'content-type': 'application/json'})) ==
pulp_auto.item: DEBUG: .from_response() == Task({u'exception': None, u'task_type': u'pulp.server.managers.repo.importer.update_importer_config', u'_href': u'/pulp/api/v2/tasks/5b037765-fde9-415d-9510-244a20bd723c/', u'task_id': u'5b037765-fde9-415d-9510-244a20bd723c', u'tags': [u'pulp:repository:zoo', u'pulp:repository_importer:yum_importer', u'pulp:action:update_importer'], u'finish_time': u'2015-09-03T00:02:55Z', u'_ns': u'task_status', u'start_time': u'2015-09-03T00:02:55Z', u'traceback': u'Traceback (most recent call last):\n File "/usr/lib/python2.6/site-packages/celery/app/trace.py", line 240, in trace_task\n R = retval = fun(*args, **kwargs)\n File "/usr/lib/python2.6/site-packages/pulp/server/async/tasks.py", line 394, in __call__\n return super(Task, self).__call__(*args, **kwargs)\n File "/usr/lib/python2.6/site-packages/celery/app/trace.py", line 437, in __protected_call__\n return self.run(*args, **kwargs)\n File "/usr/lib/python2.6/site-packages/pulp/server/managers/repo/importer.py", line 300, in update_importer_config\n return serializer.data\n File "/usr/lib/python2.6/site-packages/pulp/server/webservices/views/serializers/__init__.py", line 128, in data\n return self._to_representation(self.instance)\n File "/usr/lib/python2.6/site-packages/pulp/server/webservices/views/serializers/__init__.py", line 76, in _to_representation\n href = self.get_href(instance)\n File "/usr/lib/python2.6/site-packages/pulp/server/webservices/views/serializers/__init__.py", line 172, in get_href\n \'importer_id\': instance[\'id\']})\n File "/usr/lib/python2.6/site-packages/django/core/urlresolvers.py", line 451, in reverse\n resolver = get_resolver(urlconf)\n File "/usr/lib/python2.6/site-packages/django/utils/functional.py", line 27, in wrapper\n result = func(*args)\n File "/usr/lib/python2.6/site-packages/django/core/urlresolvers.py", line 118, in get_resolver\n urlconf = settings.ROOT_URLCONF\n File "/usr/lib/python2.6/site-packages/django/utils/functional.py", line 184, in inner\n self._setup()\n File "/usr/lib/python2.6/site-packages/django/conf/__init__.py", line 40, in _setup\n raise ImportError("Settings cannot be imported, because environment variable %s is undefined." % ENVIRONMENT_VARIABLE)\nImportError: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.\n', u'spawned_tasks': [], u'progress_report': {}, u'queue': u'reserved_resource_worker-1@ec2-54-78-144-90.eu-west-1.compute.amazonaws.com.dq', u'state': u'error', u'worker_name': u'reserved_resource_worker-1@ec2-54-78-144-90.eu-west-1.compute.amazonaws.com', u'result': None, u'error': {u'code': u'PLP0000', u'data': {}, u'description': u'Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.', u'sub_errors': []}, u'_id': {u'$oid': u'55e78e2f67cb7dd0e1de401a'}, u'id': u'55e78e2f67cb7dd0e1de401a'})
requests.packages.urllib3.connectionpool: INFO: Resetting dropped connection: ec2-54-78-144-90.eu-west-1.compute.amazonaws.com
requests.packages.urllib3.connectionpool: DEBUG: "GET /pulp/api/v2/tasks/5b037765-fde9-415d-9510-244a20bd723c/ HTTP/1.1" 200 2868
pulp_auto.pulp: DEBUG: .send(Request('GET', u'/tasks/5b037765-fde9-415d-9510-244a20bd723c/', data='{}', headers={'content-type': 'application/json'})) ==
pulp_auto.item: DEBUG: .from_response() == Task({u'exception': None, u'task_type': u'pulp.server.managers.repo.importer.update_importer_config', u'_href': u'/pulp/api/v2/tasks/5b037765-fde9-415d-9510-244a20bd723c/', u'task_id': u'5b037765-fde9-415d-9510-244a20bd723c', u'tags': [u'pulp:repository:zoo', u'pulp:repository_importer:yum_importer', u'pulp:action:update_importer'], u'finish_time': u'2015-09-03T00:02:55Z', u'_ns': u'task_status', u'start_time': u'2015-09-03T00:02:55Z', u'traceback': u'Traceback (most recent call last):\n File "/usr/lib/python2.6/site-packages/celery/app/trace.py", line 240, in trace_task\n R = retval = fun(*args, **kwargs)\n File "/usr/lib/python2.6/site-packages/pulp/server/async/tasks.py", line 394, in __call__\n return super(Task, self).__call__(*args, **kwargs)\n File "/usr/lib/python2.6/site-packages/celery/app/trace.py", line 437, in __protected_call__\n return self.run(*args, **kwargs)\n File "/usr/lib/python2.6/site-packages/pulp/server/managers/repo/importer.py", line 300, in update_importer_config\n return serializer.data\n File "/usr/lib/python2.6/site-packages/pulp/server/webservices/views/serializers/__init__.py", line 128, in data\n return self._to_representation(self.instance)\n File "/usr/lib/python2.6/site-packages/pulp/server/webservices/views/serializers/__init__.py", line 76, in _to_representation\n href = self.get_href(instance)\n File "/usr/lib/python2.6/site-packages/pulp/server/webservices/views/serializers/__init__.py", line 172, in get_href\n \'importer_id\': instance[\'id\']})\n File "/usr/lib/python2.6/site-packages/django/core/urlresolvers.py", line 451, in reverse\n resolver = get_resolver(urlconf)\n File "/usr/lib/python2.6/site-packages/django/utils/functional.py", line 27, in wrapper\n result = func(*args)\n File "/usr/lib/python2.6/site-packages/django/core/urlresolvers.py", line 118, in get_resolver\n urlconf = settings.ROOT_URLCONF\n File "/usr/lib/python2.6/site-packages/django/utils/functional.py", line 184, in inner\n self._setup()\n File "/usr/lib/python2.6/site-packages/django/conf/__init__.py", line 40, in _setup\n raise ImportError("Settings cannot be imported, because environment variable %s is undefined." % ENVIRONMENT_VARIABLE)\nImportError: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.\n', u'spawned_tasks': [], u'progress_report': {}, u'queue': u'reserved_resource_worker-1@ec2-54-78-144-90.eu-west-1.compute.amazonaws.com.dq', u'state': u'error', u'worker_name': u'reserved_resource_worker-1@ec2-54-78-144-90.eu-west-1.compute.amazonaws.com', u'result': None, u'error': {u'code': u'PLP0000', u'data': {}, u'description': u'Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.', u'sub_errors': []}, u'_id': {u'$oid': u'55e78e2f67cb7dd0e1de401a'}, u'id': u'55e78e2f67cb7dd0e1de401a'})
--------------------- >> end captured logging << ---------------------
Traceback (most recent call last):
File "/usr/lib64/python2.7/unittest/case.py", line 369, in run
testMethod()
File "/root/pulp-automation-single-node-2.7-rhel6/tests/general_tests/test_02_repo_importer_distributor.py", line 50, in test_04_importer_update
Task.wait_for_report(self.pulp, response)
File "/root/pulp-automation-single-node-2.7-rhel6/pulp_auto/task.py", line 151, in wait_for_report
task.wait(pulp, timeout=timeout)
File "/root/pulp-automation-single-node-2.7-rhel6/pulp_auto/task.py", line 59, in wait
raise TaskFailure('Task failed: %r' % self.data['error'], task=self)
TaskFailure: Task failed: {u'code': u'PLP0000', u'data': {}, u'description': u'Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.', u'sub_errors': []}: {u'exception': None, u'task_type': u'pulp.server.managers.repo.importer.update_importer_config', u'_href': u'/pulp/api/v2/tasks/5b037765-fde9-415d-9510-244a20bd723c/', u'task_id': u'5b037765-fde9-415d-9510-244a20bd723c', u'tags': [u'pulp:repository:zoo', u'pulp:repository_importer:yum_importer', u'pulp:action:update_importer'], u'finish_time': u'2015-09-03T00:02:55Z', u'_ns': u'task_status', u'start_time': u'2015-09-03T00:02:55Z', u'traceback': u'Traceback (most recent call last):\n File "/usr/lib/python2.6/site-packages/celery/app/trace.py", line 240, in trace_task\n R = retval = fun(*args, **kwargs)\n File "/usr/lib/python2.6/site-packages/pulp/server/async/tasks.py", line 394, in __call__\n return super(Task, self).__call__(*args, **kwargs)\n File "/usr/lib/python2.6/site-packages/celery/app/trace.py", line 437, in __protected_call__\n return self.run(*args, **kwargs)\n File "/usr/lib/python2.6/site-packages/pulp/server/managers/repo/importer.py", line 300, in update_importer_config\n return serializer.data\n File "/usr/lib/python2.6/site-packages/pulp/server/webservices/views/serializers/__init__.py", line 128, in data\n return self._to_representation(self.instance)\n File "/usr/lib/python2.6/site-packages/pulp/server/webservices/views/serializers/__init__.py", line 76, in _to_representation\n href = self.get_href(instance)\n File "/usr/lib/python2.6/site-packages/pulp/server/webservices/views/serializers/__init__.py", line 172, in get_href\n \'importer_id\': instance[\'id\']})\n File "/usr/lib/python2.6/site-packages/django/core/urlresolvers.py", line 451, in reverse\n resolver = get_resolver(urlconf)\n File "/usr/lib/python2.6/site-packages/django/utils/functional.py", line 27, in wrapper\n result = func(*args)\n File "/usr/lib/python2.6/site-packages/django/core/urlresolvers.py", line 118, in get_resolver\n urlconf = settings.ROOT_URLCONF\n File "/usr/lib/python2.6/site-packages/django/utils/functional.py", line 184, in inner\n self._setup()\n File "/usr/lib/python2.6/site-packages/django/conf/__init__.py", line 40, in _setup\n raise ImportError("Settings cannot be imported, because environment variable %s is undefined." % ENVIRONMENT_VARIABLE)\nImportError: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.\n', u'spawned_tasks': [], u'progress_report': {}, u'queue': u'reserved_resource_worker-1@ec2-54-78-144-90.eu-west-1.compute.amazonaws.com.dq', u'state': u'error', u'worker_name': u'reserved_resource_worker-1@ec2-54-78-144-90.eu-west-1.compute.amazonaws.com', u'result': None, u'error': {u'code': u'PLP0000', u'data': {}, u'description': u'Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.', u'sub_errors': []}, u'_id': {u'$oid': u'55e78e2f67cb7dd0e1de401a'}, u'id': u'55e78e2f67cb7dd0e1de401a'}
-------------------- >> begin captured logging << --------------------
requests.packages.urllib3.connectionpool: INFO: Resetting dropped connection: ec2-54-78-144-90.eu-west-1.compute.amazonaws.com
requests.packages.urllib3.connectionpool: DEBUG: "PUT /pulp/api/v2/repositories/zoo/importers/yum_importer/ HTTP/1.1" 202 172
pulp_auto.pulp: DEBUG: .send(Request('PUT', u'/repositories/zoo/importers/yum_importer/', data='{"importer_config": {"num_units": 10}}', headers={'content-type': 'application/json'})) ==
requests.packages.urllib3.connectionpool: INFO: Resetting dropped connection: ec2-54-78-144-90.eu-west-1.compute.amazonaws.com
requests.packages.urllib3.connectionpool: DEBUG: "GET /pulp/api/v2/tasks/5b037765-fde9-415d-9510-244a20bd723c/ HTTP/1.1" 200 2868
pulp_auto.pulp: DEBUG: .send(Request('GET', u'/tasks/5b037765-fde9-415d-9510-244a20bd723c/', data='{}', headers={'content-type': 'application/json'})) ==
pulp_auto.item: DEBUG: .from_response() == Task({u'exception': None, u'task_type': u'pulp.server.managers.repo.importer.update_importer_config', u'_href': u'/pulp/api/v2/tasks/5b037765-fde9-415d-9510-244a20bd723c/', u'task_id': u'5b037765-fde9-415d-9510-244a20bd723c', u'tags': [u'pulp:repository:zoo', u'pulp:repository_importer:yum_importer', u'pulp:action:update_importer'], u'finish_time': u'2015-09-03T00:02:55Z', u'_ns': u'task_status', u'start_time': u'2015-09-03T00:02:55Z', u'traceback': u'Traceback (most recent call last):\n File "/usr/lib/python2.6/site-packages/celery/app/trace.py", line 240, in trace_task\n R = retval = fun(*args, **kwargs)\n File "/usr/lib/python2.6/site-packages/pulp/server/async/tasks.py", line 394, in __call__\n return super(Task, self).__call__(*args, **kwargs)\n File "/usr/lib/python2.6/site-packages/celery/app/trace.py", line 437, in __protected_call__\n return self.run(*args, **kwargs)\n File "/usr/lib/python2.6/site-packages/pulp/server/managers/repo/importer.py", line 300, in update_importer_config\n return serializer.data\n File "/usr/lib/python2.6/site-packages/pulp/server/webservices/views/serializers/__init__.py", line 128, in data\n return self._to_representation(self.instance)\n File "/usr/lib/python2.6/site-packages/pulp/server/webservices/views/serializers/__init__.py", line 76, in _to_representation\n href = self.get_href(instance)\n File "/usr/lib/python2.6/site-packages/pulp/server/webservices/views/serializers/__init__.py", line 172, in get_href\n \'importer_id\': instance[\'id\']})\n File "/usr/lib/python2.6/site-packages/django/core/urlresolvers.py", line 451, in reverse\n resolver = get_resolver(urlconf)\n File "/usr/lib/python2.6/site-packages/django/utils/functional.py", line 27, in wrapper\n result = func(*args)\n File "/usr/lib/python2.6/site-packages/django/core/urlresolvers.py", line 118, in get_resolver\n urlconf = settings.ROOT_URLCONF\n File "/usr/lib/python2.6/site-packages/django/utils/functional.py", line 184, in inner\n self._setup()\n File "/usr/lib/python2.6/site-packages/django/conf/__init__.py", line 40, in _setup\n raise ImportError("Settings cannot be imported, because environment variable %s is undefined." % ENVIRONMENT_VARIABLE)\nImportError: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.\n', u'spawned_tasks': [], u'progress_report': {}, u'queue': u'reserved_resource_worker-1@ec2-54-78-144-90.eu-west-1.compute.amazonaws.com.dq', u'state': u'error', u'worker_name': u'reserved_resource_worker-1@ec2-54-78-144-90.eu-west-1.compute.amazonaws.com', u'result': None, u'error': {u'code': u'PLP0000', u'data': {}, u'description': u'Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.', u'sub_errors': []}, u'_id': {u'$oid': u'55e78e2f67cb7dd0e1de401a'}, u'id': u'55e78e2f67cb7dd0e1de401a'})
requests.packages.urllib3.connectionpool: INFO: Resetting dropped connection: ec2-54-78-144-90.eu-west-1.compute.amazonaws.com
requests.packages.urllib3.connectionpool: DEBUG: "GET /pulp/api/v2/tasks/5b037765-fde9-415d-9510-244a20bd723c/ HTTP/1.1" 200 2868
pulp_auto.pulp: DEBUG: .send(Request('GET', u'/tasks/5b037765-fde9-415d-9510-244a20bd723c/', data='{}', headers={'content-type': 'application/json'})) ==
pulp_auto.item: DEBUG: .from_response() == Task({u'exception': None, u'task_type': u'pulp.server.managers.repo.importer.update_importer_config', u'_href': u'/pulp/api/v2/tasks/5b037765-fde9-415d-9510-244a20bd723c/', u'task_id': u'5b037765-fde9-415d-9510-244a20bd723c', u'tags': [u'pulp:repository:zoo', u'pulp:repository_importer:yum_importer', u'pulp:action:update_importer'], u'finish_time': u'2015-09-03T00:02:55Z', u'_ns': u'task_status', u'start_time': u'2015-09-03T00:02:55Z', u'traceback': u'Traceback (most recent call last):\n File "/usr/lib/python2.6/site-packages/celery/app/trace.py", line 240, in trace_task\n R = retval = fun(*args, **kwargs)\n File "/usr/lib/python2.6/site-packages/pulp/server/async/tasks.py", line 394, in __call__\n return super(Task, self).__call__(*args, **kwargs)\n File "/usr/lib/python2.6/site-packages/celery/app/trace.py", line 437, in __protected_call__\n return self.run(*args, **kwargs)\n File "/usr/lib/python2.6/site-packages/pulp/server/managers/repo/importer.py", line 300, in update_importer_config\n return serializer.data\n File "/usr/lib/python2.6/site-packages/pulp/server/webservices/views/serializers/__init__.py", line 128, in data\n return self._to_representation(self.instance)\n File "/usr/lib/python2.6/site-packages/pulp/server/webservices/views/serializers/__init__.py", line 76, in _to_representation\n href = self.get_href(instance)\n File "/usr/lib/python2.6/site-packages/pulp/server/webservices/views/serializers/__init__.py", line 172, in get_href\n \'importer_id\': instance[\'id\']})\n File "/usr/lib/python2.6/site-packages/django/core/urlresolvers.py", line 451, in reverse\n resolver = get_resolver(urlconf)\n File "/usr/lib/python2.6/site-packages/django/utils/functional.py", line 27, in wrapper\n result = func(*args)\n File "/usr/lib/python2.6/site-packages/django/core/urlresolvers.py", line 118, in get_resolver\n urlconf = settings.ROOT_URLCONF\n File "/usr/lib/python2.6/site-packages/django/utils/functional.py", line 184, in inner\n self._setup()\n File "/usr/lib/python2.6/site-packages/django/conf/__init__.py", line 40, in _setup\n raise ImportError("Settings cannot be imported, because environment variable %s is undefined." % ENVIRONMENT_VARIABLE)\nImportError: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.\n', u'spawned_tasks': [], u'progress_report': {}, u'queue': u'reserved_resource_worker-1@ec2-54-78-144-90.eu-west-1.compute.amazonaws.com.dq', u'state': u'error', u'worker_name': u'reserved_resource_worker-1@ec2-54-78-144-90.eu-west-1.compute.amazonaws.com', u'result': None, u'error': {u'code': u'PLP0000', u'data': {}, u'description': u'Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.', u'sub_errors': []}, u'_id': {u'$oid': u'55e78e2f67cb7dd0e1de401a'}, u'id': u'55e78e2f67cb7dd0e1de401a'})
--------------------- >> end captured logging << ---------------------: None
Related issues
Actions