mirror of
https://github.com/ansible/awx.git
synced 2026-02-23 05:55:59 -03:30
flake8 fixes
This commit is contained in:
@@ -81,6 +81,102 @@ TEST_FACT_SERVICES = [
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
TEST_FACT_FILES = [
|
||||||
|
{
|
||||||
|
"uid": 0,
|
||||||
|
"woth": False,
|
||||||
|
"mtime": 1436810539.5895822,
|
||||||
|
"inode": 525214,
|
||||||
|
"isgid": False,
|
||||||
|
"size": 0,
|
||||||
|
"isuid": False,
|
||||||
|
"isreg": True,
|
||||||
|
"gid": 0,
|
||||||
|
"ischr": False,
|
||||||
|
"wusr": True,
|
||||||
|
"xoth": False,
|
||||||
|
"islnk": False,
|
||||||
|
"nlink": 1,
|
||||||
|
"issock": False,
|
||||||
|
"rgrp": True,
|
||||||
|
"path": "/test/1948",
|
||||||
|
"xusr": False,
|
||||||
|
"atime": 1436810539.5895822,
|
||||||
|
"isdir": False,
|
||||||
|
"ctime": 1436810539.5895822,
|
||||||
|
"isblk": False,
|
||||||
|
"wgrp": False,
|
||||||
|
"xgrp": False,
|
||||||
|
"dev": 64768,
|
||||||
|
"roth": True,
|
||||||
|
"isfifo": False,
|
||||||
|
"mode": "0644",
|
||||||
|
"rusr": True
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"uid": 0,
|
||||||
|
"woth": False,
|
||||||
|
"mtime": 1436810540.4955823,
|
||||||
|
"inode": 526295,
|
||||||
|
"isgid": False,
|
||||||
|
"size": 0,
|
||||||
|
"isuid": False,
|
||||||
|
"isreg": True,
|
||||||
|
"gid": 0,
|
||||||
|
"ischr": False,
|
||||||
|
"wusr": True,
|
||||||
|
"xoth": False,
|
||||||
|
"islnk": False,
|
||||||
|
"nlink": 1,
|
||||||
|
"issock": False,
|
||||||
|
"rgrp": True,
|
||||||
|
"path": "/test/3029",
|
||||||
|
"xusr": False,
|
||||||
|
"atime": 1436810540.4955823,
|
||||||
|
"isdir": False,
|
||||||
|
"ctime": 1436810540.4955823,
|
||||||
|
"isblk": False,
|
||||||
|
"wgrp": False,
|
||||||
|
"xgrp": False,
|
||||||
|
"dev": 64768,
|
||||||
|
"roth": True,
|
||||||
|
"isfifo": False,
|
||||||
|
"mode": "0644",
|
||||||
|
"rusr": True
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"uid": 0,
|
||||||
|
"woth": False,
|
||||||
|
"mtime": 1436810540.5825822,
|
||||||
|
"inode": 526401,
|
||||||
|
"isgid": False,
|
||||||
|
"size": 0,
|
||||||
|
"isuid": False,
|
||||||
|
"isreg": True,
|
||||||
|
"gid": 0,
|
||||||
|
"ischr": False,
|
||||||
|
"wusr": True,
|
||||||
|
"xoth": False,
|
||||||
|
"islnk": False,
|
||||||
|
"nlink": 1,
|
||||||
|
"issock": False,
|
||||||
|
"rgrp": True,
|
||||||
|
"path": "/test/3135",
|
||||||
|
"xusr": False,
|
||||||
|
"atime": 1436810540.5825822,
|
||||||
|
"isdir": False,
|
||||||
|
"ctime": 1436810540.5825822,
|
||||||
|
"isblk": False,
|
||||||
|
"wgrp": False,
|
||||||
|
"xgrp": False,
|
||||||
|
"dev": 64768,
|
||||||
|
"roth": True,
|
||||||
|
"isfifo": False,
|
||||||
|
"mode": "0644",
|
||||||
|
"rusr": True
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
FACT_FIXTURES = {
|
FACT_FIXTURES = {
|
||||||
'ansible': TEST_FACT_ANSIBLE,
|
'ansible': TEST_FACT_ANSIBLE,
|
||||||
'packages': TEST_FACT_PACKAGES,
|
'packages': TEST_FACT_PACKAGES,
|
||||||
|
|||||||
@@ -1259,8 +1259,8 @@ class InventoryUpdate(UnifiedJob, InventorySourceOptions):
|
|||||||
if not super(InventoryUpdate, self).can_start:
|
if not super(InventoryUpdate, self).can_start:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if (self.source != 'custom'
|
if (self.source != 'custom' and
|
||||||
and not (self.credential and self.credential.active)):
|
not (self.credential and self.credential.active)):
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|||||||
@@ -47,8 +47,8 @@ class ProjectOptions(models.Model):
|
|||||||
def get_local_path_choices(cls):
|
def get_local_path_choices(cls):
|
||||||
if os.path.exists(settings.PROJECTS_ROOT):
|
if os.path.exists(settings.PROJECTS_ROOT):
|
||||||
paths = [x.decode('utf-8') for x in os.listdir(settings.PROJECTS_ROOT)
|
paths = [x.decode('utf-8') for x in os.listdir(settings.PROJECTS_ROOT)
|
||||||
if os.path.isdir(os.path.join(settings.PROJECTS_ROOT, x))
|
if (os.path.isdir(os.path.join(settings.PROJECTS_ROOT, x)) and
|
||||||
and not x.startswith('.') and not x.startswith('_')]
|
not x.startswith('.') and not x.startswith('_'))]
|
||||||
qs = Project.objects.filter(active=True)
|
qs = Project.objects.filter(active=True)
|
||||||
used_paths = qs.values_list('local_path', flat=True)
|
used_paths = qs.values_list('local_path', flat=True)
|
||||||
return [x for x in paths if x not in used_paths]
|
return [x for x in paths if x not in used_paths]
|
||||||
|
|||||||
Reference in New Issue
Block a user