From edb646fdf9c4c1a6d949d9787610a8c04116a5a0 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Wed, 17 Dec 2014 11:06:56 -0500 Subject: [PATCH] Use smart_str more widely with project paths... hopefully this takes care of the remaining issues --- awx/main/models/projects.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/awx/main/models/projects.py b/awx/main/models/projects.py index b3da3ae76a..b82b2350eb 100644 --- a/awx/main/models/projects.py +++ b/awx/main/models/projects.py @@ -162,7 +162,7 @@ class ProjectOptions(models.Model): results = [] project_path = self.get_project_path() if project_path: - for dirpath, dirnames, filenames in os.walk(unicode(project_path)): + for dirpath, dirnames, filenames in os.walk(smart_str(project_path)): for filename in filenames: if os.path.splitext(filename)[-1] not in ['.yml', '.yaml']: continue @@ -183,7 +183,7 @@ class ProjectOptions(models.Model): continue if not matched: continue - playbook = os.path.relpath(playbook, project_path) + playbook = os.path.relpath(playbook, smart_str(project_path)) # Filter files in a roles subdirectory. if 'roles' in playbook.split(os.sep): continue @@ -279,7 +279,7 @@ class Project(UnifiedJobTemplate, ProjectOptions): project_path = self.get_project_path() if project_path: try: - mtime = os.path.getmtime(project_path) + mtime = os.path.getmtime(smart_str(project_path)) dt = datetime.datetime.fromtimestamp(mtime) return make_aware(dt, get_default_timezone()) except os.error: