Fixing up some pep8 issues

This commit is contained in:
Matthew Jones
2015-02-03 13:46:58 -05:00
parent 61e2683f57
commit 6e6a709165
12 changed files with 54 additions and 64 deletions

View File

@@ -20,7 +20,7 @@ class TokenAuthentication(authentication.TokenAuthentication):
def _get_x_auth_token_header(self, request): def _get_x_auth_token_header(self, request):
auth = request.META.get('HTTP_X_AUTH_TOKEN', '') auth = request.META.get('HTTP_X_AUTH_TOKEN', '')
if type(auth) == type(''): if isinstance(auth, type('')):
# Work around django test client oddness # Work around django test client oddness
auth = auth.encode(HTTP_HEADER_ENCODING) auth = auth.encode(HTTP_HEADER_ENCODING)
return auth return auth

View File

@@ -176,7 +176,7 @@ class GenericAPIView(generics.GenericAPIView, APIView):
# Override when called from browsable API to generate raw data form; # Override when called from browsable API to generate raw data form;
# always remove read only fields from sample raw data. # always remove read only fields from sample raw data.
if hasattr(self, '_raw_data_form_marker'): if hasattr(self, '_raw_data_form_marker'):
for name, field in serializer.fields.items(): for name, field in serializer.fields.items():
if getattr(field, 'read_only', None): if getattr(field, 'read_only', None):
del serializer.fields[name] del serializer.fields[name]
return serializer return serializer
@@ -476,9 +476,9 @@ class RetrieveDestroyAPIView(RetrieveAPIView, generics.RetrieveDestroyAPIView):
# somewhat lame that delete has to call it's own permissions check # somewhat lame that delete has to call it's own permissions check
obj = self.get_object() obj = self.get_object()
# FIXME: Why isn't the active check being caught earlier by RBAC? # FIXME: Why isn't the active check being caught earlier by RBAC?
if getattr(obj, 'active', True) == False: if not getattr(obj, 'active', True):
raise Http404() raise Http404()
if getattr(obj, 'is_active', True) == False: if not getattr(obj, 'is_active', True):
raise Http404() raise Http404()
if not request.user.can_access(self.model, 'delete', obj): if not request.user.can_access(self.model, 'delete', obj):
raise PermissionDenied() raise PermissionDenied()

View File

@@ -107,8 +107,7 @@ class ModelAccessPermission(permissions.BasePermission):
# Check permissions for the given view and object, based on the request # Check permissions for the given view and object, based on the request
# method used. # method used.
check_method = getattr(self, 'check_%s_permissions' % \ check_method = getattr(self, 'check_%s_permissions' % request.method.lower(), None)
request.method.lower(), None)
result = check_method and check_method(request, view, obj) result = check_method and check_method(request, view, obj)
if not result: if not result:
raise PermissionDenied() raise PermissionDenied()

View File

@@ -30,9 +30,9 @@ class BrowsableAPIRenderer(renderers.BrowsableAPIRenderer):
'''Never show auto-generated form (only raw form).''' '''Never show auto-generated form (only raw form).'''
obj = getattr(view, 'object', None) obj = getattr(view, 'object', None)
if not self.show_form_for_method(view, method, request, obj): if not self.show_form_for_method(view, method, request, obj):
return return
if method in ('DELETE', 'OPTIONS'): if method in ('DELETE', 'OPTIONS'):
return True # Don't actually need to return a form return True # Don't actually need to return a form
def get_context(self, data, accepted_media_type, renderer_context): def get_context(self, data, accepted_media_type, renderer_context):
context = super(BrowsableAPIRenderer, self).get_context(data, accepted_media_type, renderer_context) context = super(BrowsableAPIRenderer, self).get_context(data, accepted_media_type, renderer_context)

View File

@@ -42,7 +42,7 @@ from awx.main.utils import update_scm_url, get_type_for_model, get_model_for_typ
logger = logging.getLogger('awx.api.serializers') logger = logging.getLogger('awx.api.serializers')
# Fields that should be summarized regardless of object type. # Fields that should be summarized regardless of object type.
DEFAULT_SUMMARY_FIELDS = ('name', 'description')#, 'created_by', 'modified_by')#, 'type') DEFAULT_SUMMARY_FIELDS = ('name', 'description')# , 'created_by', 'modified_by')#, 'type')
# Keys are fields (foreign keys) where, if found on an instance, summary info # Keys are fields (foreign keys) where, if found on an instance, summary info
# should be added to the serialized data. Values are a tuple of field names on # should be added to the serialized data. Values are a tuple of field names on
@@ -93,7 +93,7 @@ class ChoiceField(fields.ChoiceField):
# Remove extra blank option if one is already present (for writable # Remove extra blank option if one is already present (for writable
# field) or if present at all for read-only fields. # field) or if present at all for read-only fields.
if ([x[0] for x in self.choices].count(u'') > 1 or self.read_only) \ if ([x[0] for x in self.choices].count(u'') > 1 or self.read_only) \
and BLANK_CHOICE_DASH[0] in self.choices: and BLANK_CHOICE_DASH[0] in self.choices:
self.choices = [x for x in self.choices self.choices = [x for x in self.choices
if x != BLANK_CHOICE_DASH[0]] if x != BLANK_CHOICE_DASH[0]]
@@ -450,10 +450,10 @@ class UnifiedJobListSerializer(UnifiedJobSerializer):
'result_stdout') 'result_stdout')
def get_types(self): def get_types(self):
if type(self) is UnifiedJobListSerializer: if type(self) is UnifiedJobListSerializer:
return ['project_update', 'inventory_update', 'job', 'system_job'] return ['project_update', 'inventory_update', 'job', 'system_job']
else: else:
return super(UnifiedJobListSerializer, self).get_types() return super(UnifiedJobListSerializer, self).get_types()
def to_native(self, obj): def to_native(self, obj):
serializer_class = None serializer_class = None
@@ -495,7 +495,7 @@ class UnifiedJobStdoutSerializer(UnifiedJobSerializer):
class UserSerializer(BaseSerializer): class UserSerializer(BaseSerializer):
password = serializers.WritableField(required=False, default='', password = serializers.WritableField(required=False, default='',
help_text='Write-only field used to change the password.') help_text='Write-only field used to change the password.')
ldap_dn = serializers.Field(source='profile.ldap_dn') ldap_dn = serializers.Field(source='profile.ldap_dn')
class Meta: class Meta:
@@ -805,8 +805,7 @@ class HostSerializer(BaseSerializerWithVariables):
pass pass
d.update({'recent_jobs': [{ d.update({'recent_jobs': [{
'id': j.job.id, 'id': j.job.id,
'name': j.job.job_template.name if j.job.job_template is not None 'name': j.job.job_template.name if j.job.job_template is not None else "",
else "",
'status': j.job.status, 'status': j.job.status,
'finished': j.job.finished, 'finished': j.job.finished,
} for j in obj.job_host_summaries.filter(job__active=True).select_related('job__job_template').order_by('-created')[:5]]}) } for j in obj.job_host_summaries.filter(job__active=True).select_related('job__job_template').order_by('-created')[:5]]})

View File

@@ -23,6 +23,7 @@ class PaginatedDecoratorTests(TestCase):
# that the paginator wraps in the way we expect. # that the paginator wraps in the way we expect.
class View(APIView): class View(APIView):
permission_classes = (AllowAny,) permission_classes = (AllowAny,)
@paginated @paginated
def get(self, request, limit, ordering, offset): def get(self, request, limit, ordering, offset):
return ['a', 'b', 'c', 'd', 'e'], 26, None return ['a', 'b', 'c', 'd', 'e'], 26, None

View File

@@ -82,11 +82,11 @@ class ApiRootView(APIView):
current = reverse('api:api_v1_root_view', args=[]) current = reverse('api:api_v1_root_view', args=[])
data = dict( data = dict(
description = 'Ansible Tower REST API', description = 'Ansible Tower REST API',
current_version = current, current_version = current,
available_versions = dict( available_versions = dict(
v1 = current v1 = current
) )
) )
return Response(data) return Response(data)
@@ -335,7 +335,7 @@ class DashboardView(APIView):
data['organizations'] = {'url': reverse('api:organization_list'), data['organizations'] = {'url': reverse('api:organization_list'),
'total': organization_list.count()} 'total': organization_list.count()}
data['teams'] = {'url': reverse('api:team_list'), data['teams'] = {'url': reverse('api:team_list'),
'total': team_list.count()} 'total': team_list.count()}
data['credentials'] = {'url': reverse('api:credential_list'), data['credentials'] = {'url': reverse('api:credential_list'),
'total': credential_list.count()} 'total': credential_list.count()}
data['job_templates'] = {'url': reverse('api:job_template_list'), data['job_templates'] = {'url': reverse('api:job_template_list'),
@@ -421,7 +421,7 @@ class DashboardInventoryGraphView(APIView):
host_data = [] host_data = []
for element in created_hosts.time_series(end_date, start_date, interval=interval)[::-1]: for element in created_hosts.time_series(end_date, start_date, interval=interval)[::-1]:
host_data.append([time.mktime(element[0].timetuple()), host_data.append([time.mktime(element[0].timetuple()),
count_hosts - last_delta]) count_hosts - last_delta])
count_hosts -= last_delta count_hosts -= last_delta
last_delta = element[1] last_delta = element[1]
@@ -1068,9 +1068,9 @@ class GroupHostsList(SubListCreateAPIView):
def create(self, request, *args, **kwargs): def create(self, request, *args, **kwargs):
parent_group = Group.objects.get(id=self.kwargs['pk']) parent_group = Group.objects.get(id=self.kwargs['pk'])
existing_hosts = Host.objects.filter(inventory=parent_group.inventory, name=request.DATA['name']) existing_hosts = Host.objects.filter(inventory=parent_group.inventory, name=request.DATA['name'])
if existing_hosts.count() > 0 and ('variables' not in request.DATA or \ if existing_hosts.count() > 0 and ('variables' not in request.DATA or
request.DATA['variables'] == '' or \ request.DATA['variables'] == '' or
request.DATA['variables'] == '{}' or \ request.DATA['variables'] == '{}' or
request.DATA['variables'] == '---'): request.DATA['variables'] == '---'):
request.DATA['id'] = existing_hosts[0].id request.DATA['id'] = existing_hosts[0].id
return self.attach(request, *args, **kwargs) return self.attach(request, *args, **kwargs)
@@ -1121,9 +1121,9 @@ class GroupDetail(RetrieveUpdateDestroyAPIView):
def destroy(self, request, *args, **kwargs): def destroy(self, request, *args, **kwargs):
obj = self.get_object() obj = self.get_object()
# FIXME: Why isn't the active check being caught earlier by RBAC? # FIXME: Why isn't the active check being caught earlier by RBAC?
if getattr(obj, 'active', True) == False: if not getattr(obj, 'active', True):
raise Http404() raise Http404()
if getattr(obj, 'is_active', True) == False: if not getattr(obj, 'is_active', True):
raise Http404() raise Http404()
if not request.user.can_access(self.model, 'delete', obj): if not request.user.can_access(self.model, 'delete', obj):
raise PermissionDenied() raise PermissionDenied()
@@ -1178,8 +1178,7 @@ class InventoryScriptView(RetrieveAPIView):
model = Inventory model = Inventory
serializer_class = InventoryScriptSerializer serializer_class = InventoryScriptSerializer
authentication_classes = [JobTaskAuthentication] + \ authentication_classes = [JobTaskAuthentication] + api_settings.DEFAULT_AUTHENTICATION_CLASSES
api_settings.DEFAULT_AUTHENTICATION_CLASSES
permission_classes = (JobTaskPermission,) permission_classes = (JobTaskPermission,)
filter_backends = () filter_backends = ()
@@ -1319,9 +1318,9 @@ class InventoryInventorySourcesList(SubListAPIView):
class InventorySourceList(ListAPIView): class InventorySourceList(ListAPIView):
model = InventorySource model = InventorySource
serializer_class = InventorySourceSerializer serializer_class = InventorySourceSerializer
new_in_14 = True new_in_14 = True
class InventorySourceDetail(RetrieveUpdateAPIView): class InventorySourceDetail(RetrieveUpdateAPIView):
@@ -1950,8 +1949,7 @@ class GroupJobEventsList(BaseJobEventsList):
class JobJobEventsList(BaseJobEventsList): class JobJobEventsList(BaseJobEventsList):
parent_model = Job parent_model = Job
authentication_classes = [JobTaskAuthentication] + \ authentication_classes = [JobTaskAuthentication] + api_settings.DEFAULT_AUTHENTICATION_CLASSES
api_settings.DEFAULT_AUTHENTICATION_CLASSES
permission_classes = (JobTaskPermission,) permission_classes = (JobTaskPermission,)
# Post allowed for job event callback only. # Post allowed for job event callback only.
@@ -1973,8 +1971,7 @@ class JobJobPlaysList(BaseJobEventsList):
parent_model = Job parent_model = Job
view_name = 'Job Plays List' view_name = 'Job Plays List'
authentication_classes = [JobTaskAuthentication] + \ authentication_classes = [JobTaskAuthentication] + api_settings.DEFAULT_AUTHENTICATION_CLASSES
api_settings.DEFAULT_AUTHENTICATION_CLASSES
permission_classes = (JobTaskPermission,) permission_classes = (JobTaskPermission,)
new_in_200 = True new_in_200 = True
@@ -2028,7 +2025,7 @@ class JobJobPlaysList(BaseJobEventsList):
elif event_aggregate['event'] == 'runner_on_unreachable': elif event_aggregate['event'] == 'runner_on_unreachable':
unreachable_count = event_aggregate['id__count'] unreachable_count = event_aggregate['id__count']
for change_aggregate in change_aggregates: for change_aggregate in change_aggregates:
if change_aggregate['changed'] == False: if not change_aggregate['changed']:
ok_count = change_aggregate['id__count'] ok_count = change_aggregate['id__count']
else: else:
changed_count = change_aggregate['id__count'] changed_count = change_aggregate['id__count']
@@ -2050,8 +2047,7 @@ class JobJobTasksList(BaseJobEventsList):
and their completion status. and their completion status.
""" """
parent_model = Job parent_model = Job
authentication_classes = [JobTaskAuthentication] + \ authentication_classes = [JobTaskAuthentication] + api_settings.DEFAULT_AUTHENTICATION_CLASSES
api_settings.DEFAULT_AUTHENTICATION_CLASSES
permission_classes = (JobTaskPermission,) permission_classes = (JobTaskPermission,)
view_name = 'Job Play Tasks List' view_name = 'Job Play Tasks List'
new_in_200 = True new_in_200 = True
@@ -2141,9 +2137,7 @@ class JobJobTasksList(BaseJobEventsList):
'host_count': 0, 'host_count': 0,
'id': task_start_event.id, 'id': task_start_event.id,
'modified': task_start_event.modified, 'modified': task_start_event.modified,
'name': 'Gathering Facts' if 'name': 'Gathering Facts' if task_start_event.event == 'playbook_on_setup' else task_start_event.task,
task_start_event.event == 'playbook_on_setup' else
task_start_event.task,
'reported_hosts': 0, 'reported_hosts': 0,
'skipped_count': 0, 'skipped_count': 0,
'unreachable_count': 0, 'unreachable_count': 0,

View File

@@ -355,7 +355,7 @@ class HostAccess(BaseAccess):
inventory_pk = get_pk_from_dict(data, 'inventory') inventory_pk = get_pk_from_dict(data, 'inventory')
inventory = get_object_or_400(Inventory, pk=inventory_pk) inventory = get_object_or_400(Inventory, pk=inventory_pk)
if not self.user.can_access(Inventory, 'change', inventory, None): if not self.user.can_access(Inventory, 'change', inventory, None):
return False return False
# Check to see if we have enough licenses # Check to see if we have enough licenses
reader = TaskSerializer() reader = TaskSerializer()
@@ -1000,8 +1000,7 @@ class JobTemplateAccess(BaseAccess):
obj.job_type == PERM_INVENTORY_CHECK: obj.job_type == PERM_INVENTORY_CHECK:
has_perm = True has_perm = True
dep_access = self.user.can_access(Inventory, 'read', obj.inventory) and \ dep_access = self.user.can_access(Inventory, 'read', obj.inventory) and self.user.can_access(Project, 'read', obj.project)
self.user.can_access(Project, 'read', obj.project)
return dep_access and has_perm return dep_access and has_perm
def can_change(self, obj, data): def can_change(self, obj, data):
@@ -1150,8 +1149,7 @@ class JobAccess(BaseAccess):
has_perm = False has_perm = False
if obj.job_template is not None and self.user.can_access(JobTemplate, 'start', obj.job_template): if obj.job_template is not None and self.user.can_access(JobTemplate, 'start', obj.job_template):
has_perm = True has_perm = True
dep_access = self.user.can_access(Inventory, 'read', obj.inventory) and \ dep_access = self.user.can_access(Inventory, 'read', obj.inventory) and self.user.can_access(Project, 'read', obj.project)
self.user.can_access(Project, 'read', obj.project)
return self.can_read(obj) and dep_access and has_perm return self.can_read(obj) and dep_access and has_perm
def can_cancel(self, obj): def can_cancel(self, obj):
@@ -1317,8 +1315,8 @@ class ScheduleAccess(BaseAccess):
inventory_source_qs = self.user.get_queryset(InventorySource) inventory_source_qs = self.user.get_queryset(InventorySource)
project_qs = self.user.get_queryset(Project) project_qs = self.user.get_queryset(Project)
unified_qs = UnifiedJobTemplate.objects.filter(jobtemplate__in=job_template_qs) | \ unified_qs = UnifiedJobTemplate.objects.filter(jobtemplate__in=job_template_qs) | \
UnifiedJobTemplate.objects.filter(Q(project__in=project_qs)) | \ UnifiedJobTemplate.objects.filter(Q(project__in=project_qs)) | \
UnifiedJobTemplate.objects.filter(Q(inventorysource__in=inventory_source_qs)) UnifiedJobTemplate.objects.filter(Q(inventorysource__in=inventory_source_qs))
return qs.filter(unified_job_template__in=unified_qs) return qs.filter(unified_job_template__in=unified_qs)
def can_read(self, obj): def can_read(self, obj):

View File

@@ -18,7 +18,6 @@ class ActivityStreamRegistrar(object):
return return
from awx.main.signals import activity_stream_create, activity_stream_update, activity_stream_delete, activity_stream_associate from awx.main.signals import activity_stream_create, activity_stream_update, activity_stream_delete, activity_stream_associate
#(receiver, sender=model, dispatch_uid=self._dispatch_uid(signal, model))
if model not in self.models: if model not in self.models:
self.models.append(model) self.models.append(model)
post_save.connect(activity_stream_create, sender=model, dispatch_uid=str(self.__class__) + str(model) + "_create") post_save.connect(activity_stream_create, sender=model, dispatch_uid=str(self.__class__) + str(model) + "_create")
@@ -32,7 +31,6 @@ class ActivityStreamRegistrar(object):
dispatch_uid=str(self.__class__) + str(m2m_attr.through) + "_associate") dispatch_uid=str(self.__class__) + str(m2m_attr.through) + "_associate")
except AttributeError: except AttributeError:
pass pass
#logger.warning("Failed to attach m2m activity stream tracker on class %s attribute %s" % (model, m2mfield.name))
def disconnect(self, model): def disconnect(self, model):
if model in self.models: if model in self.models:

View File

@@ -270,6 +270,7 @@ def update_host_last_job_after_job_deleted(sender, **kwargs):
class ActivityStreamEnabled(threading.local): class ActivityStreamEnabled(threading.local):
def __init__(self): def __init__(self):
self.enabled = getattr(settings, 'ACTIVITY_STREAM_ENABLED', True) self.enabled = getattr(settings, 'ACTIVITY_STREAM_ENABLED', True)
def __nonzero__(self): def __nonzero__(self):
return bool(self.enabled) return bool(self.enabled)

View File

@@ -74,6 +74,7 @@ def tower_periodic_scheduler(self):
return last_run return last_run
except Exception, e: except Exception, e:
return None return None
def write_last_run(last_run): def write_last_run(last_run):
fd = open(settings.SCHEDULE_METADATA_LOCATION, 'w') fd = open(settings.SCHEDULE_METADATA_LOCATION, 'w')
fd.write(last_run.isoformat()) fd.write(last_run.isoformat())
@@ -208,7 +209,8 @@ class BaseTask(Task):
# tried too many times. # tried too many times.
if _attempt < 5: if _attempt < 5:
time.sleep(5) time.sleep(5)
return self.update_model(pk, return self.update_model(
pk,
_attempt=_attempt + 1, _attempt=_attempt + 1,
output_replacements=output_replacements, output_replacements=output_replacements,
**updates **updates
@@ -238,7 +240,7 @@ class BaseTask(Task):
Create a temporary directory for job-related files. Create a temporary directory for job-related files.
''' '''
path = tempfile.mkdtemp(prefix='ansible_tower_') path = tempfile.mkdtemp(prefix='ansible_tower_')
os.chmod(path, stat.S_IRUSR|stat.S_IWUSR|stat.S_IXUSR) os.chmod(path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)
return path return path
def build_private_data_file(self, instance, **kwargs): def build_private_data_file(self, instance, **kwargs):
@@ -251,7 +253,7 @@ class BaseTask(Task):
f = os.fdopen(handle, 'w') f = os.fdopen(handle, 'w')
f.write(private_data) f.write(private_data)
f.close() f.close()
os.chmod(path, stat.S_IRUSR|stat.S_IWUSR) os.chmod(path, stat.S_IRUSR | stat.S_IWUSR)
return path return path
else: else:
return '' return ''
@@ -750,11 +752,9 @@ class RunProjectUpdate(BaseTask):
passwords = super(RunProjectUpdate, self).build_passwords(project_update, passwords = super(RunProjectUpdate, self).build_passwords(project_update,
**kwargs) **kwargs)
if project_update.credential: if project_update.credential:
passwords['scm_key_unlock'] = decrypt_field(project_update.credential, passwords['scm_key_unlock'] = decrypt_field(project_update.credential, 'ssh_key_unlock')
'ssh_key_unlock')
passwords['scm_username'] = project_update.credential.username passwords['scm_username'] = project_update.credential.username
passwords['scm_password'] = decrypt_field(project_update.credential, passwords['scm_password'] = decrypt_field(project_update.credential, 'password')
'password')
return passwords return passwords
def build_env(self, project_update, **kwargs): def build_env(self, project_update, **kwargs):
@@ -1113,7 +1113,7 @@ class RunInventoryUpdate(BaseTask):
raise RuntimeError('Inventory Script does not exist') raise RuntimeError('Inventory Script does not exist')
f.write(inventory_update.source_script.script.encode('utf-8')) f.write(inventory_update.source_script.script.encode('utf-8'))
f.close() f.close()
os.chmod(path, stat.S_IRUSR|stat.S_IWUSR|stat.S_IXUSR) os.chmod(path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)
args.append(runpath) args.append(runpath)
args.append("--custom") args.append("--custom")
# try: # try:

View File

@@ -431,7 +431,7 @@ def build_proot_temp_dir():
Create a temporary directory for proot to use. Create a temporary directory for proot to use.
''' '''
path = tempfile.mkdtemp(prefix='ansible_tower_proot_') path = tempfile.mkdtemp(prefix='ansible_tower_proot_')
os.chmod(path, stat.S_IRUSR|stat.S_IWUSR|stat.S_IXUSR) os.chmod(path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)
return path return path
def wrap_args_with_proot(args, cwd, **kwargs): def wrap_args_with_proot(args, cwd, **kwargs):
@@ -455,11 +455,11 @@ def wrap_args_with_proot(args, cwd, **kwargs):
continue continue
if os.path.isdir(path): if os.path.isdir(path):
new_path = tempfile.mkdtemp(dir=kwargs['proot_temp_dir']) new_path = tempfile.mkdtemp(dir=kwargs['proot_temp_dir'])
os.chmod(new_path, stat.S_IRUSR|stat.S_IWUSR|stat.S_IXUSR) os.chmod(new_path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)
else: else:
handle, new_path = tempfile.mkstemp(dir=kwargs['proot_temp_dir']) handle, new_path = tempfile.mkstemp(dir=kwargs['proot_temp_dir'])
os.close(handle) os.close(handle)
os.chmod(new_path, stat.S_IRUSR|stat.S_IWUSR) os.chmod(new_path, stat.S_IRUSR | stat.S_IWUSR)
new_args.extend(['-b', '%s:%s' % (new_path, path)]) new_args.extend(['-b', '%s:%s' % (new_path, path)])
if 'private_data_dir' in kwargs: if 'private_data_dir' in kwargs:
show_paths = [cwd, kwargs['private_data_dir']] show_paths = [cwd, kwargs['private_data_dir']]