mirror of
https://github.com/ansible/awx.git
synced 2024-11-02 01:21:21 +03:00
fix scan job migration unicode issue
This commit is contained in:
parent
96fd07d0f3
commit
cad8710ac7
@ -12,7 +12,7 @@ logger = logging.getLogger('awx.main.migrations')
|
|||||||
|
|
||||||
def _create_fact_scan_project(ContentType, Project, org):
|
def _create_fact_scan_project(ContentType, Project, org):
|
||||||
ct = ContentType.objects.get_for_model(Project)
|
ct = ContentType.objects.get_for_model(Project)
|
||||||
name = "Tower Fact Scan - {}".format(org.name if org else "No Organization")
|
name = u"Tower Fact Scan - {}".format(org.name if org else "No Organization")
|
||||||
proj = Project(name=name,
|
proj = Project(name=name,
|
||||||
scm_url='https://github.com/ansible/awx-facts-playbooks',
|
scm_url='https://github.com/ansible/awx-facts-playbooks',
|
||||||
scm_type='git',
|
scm_type='git',
|
||||||
|
@ -19,46 +19,46 @@ from awx.main.migrations._scan_jobs import _migrate_scan_job_templates
|
|||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def organizations():
|
def organizations():
|
||||||
return [Organization.objects.create(name="org-{}".format(x)) for x in range(3)]
|
return [Organization.objects.create(name=u"org-\xe9-{}".format(x)) for x in range(3)]
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def inventories(organizations):
|
def inventories(organizations):
|
||||||
return [Inventory.objects.create(name="inv-{}".format(x),
|
return [Inventory.objects.create(name=u"inv-\xe9-{}".format(x),
|
||||||
organization=organizations[x]) for x in range(3)]
|
organization=organizations[x]) for x in range(3)]
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def job_templates_scan(inventories):
|
def job_templates_scan(inventories):
|
||||||
return [JobTemplate.objects.create(name="jt-scan-{}".format(x),
|
return [JobTemplate.objects.create(name=u"jt-\xe9-scan-{}".format(x),
|
||||||
job_type=PERM_INVENTORY_SCAN,
|
job_type=PERM_INVENTORY_SCAN,
|
||||||
inventory=inventories[x]) for x in range(3)]
|
inventory=inventories[x]) for x in range(3)]
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def job_templates_deploy(inventories):
|
def job_templates_deploy(inventories):
|
||||||
return [JobTemplate.objects.create(name="jt-deploy-{}".format(x),
|
return [JobTemplate.objects.create(name=u"jt-\xe9-deploy-{}".format(x),
|
||||||
job_type=PERM_INVENTORY_DEPLOY,
|
job_type=PERM_INVENTORY_DEPLOY,
|
||||||
inventory=inventories[x]) for x in range(3)]
|
inventory=inventories[x]) for x in range(3)]
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def project_custom(organizations):
|
def project_custom(organizations):
|
||||||
return Project.objects.create(name="proj-scan_custom",
|
return Project.objects.create(name=u"proj-\xe9-scan_custom",
|
||||||
scm_url='https://giggity.com',
|
scm_url='https://giggity.com',
|
||||||
organization=organizations[0])
|
organization=organizations[0])
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def job_templates_custom_scan_project(project_custom):
|
def job_templates_custom_scan_project(project_custom):
|
||||||
return [JobTemplate.objects.create(name="jt-scan-custom-{}".format(x),
|
return [JobTemplate.objects.create(name=u"jt-\xe9-scan-custom-{}".format(x),
|
||||||
project=project_custom,
|
project=project_custom,
|
||||||
job_type=PERM_INVENTORY_SCAN) for x in range(3)]
|
job_type=PERM_INVENTORY_SCAN) for x in range(3)]
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def job_template_scan_no_org():
|
def job_template_scan_no_org():
|
||||||
return JobTemplate.objects.create(name="jt-scan-no-org",
|
return JobTemplate.objects.create(name=u"jt-\xe9-scan-no-org",
|
||||||
job_type=PERM_INVENTORY_SCAN)
|
job_type=PERM_INVENTORY_SCAN)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user