@@ -110,7 +110,7 @@ def prepare_environment() -> None:
110110 "requirements.yml" ,
111111 ]
112112
113- print ("Running %s" % " " .join (cmd ))
113+ print ("Running %s" % " " .join (cmd ), file = sys . stderr )
114114 run = subprocess .run (
115115 cmd ,
116116 universal_newlines = True ,
@@ -135,7 +135,7 @@ def prepare_environment() -> None:
135135 "requirements.yml" ,
136136 ]
137137
138- print ("Running %s" % " " .join (cmd ))
138+ print ("Running %s" % " " .join (cmd ), file = sys . stderr )
139139 run = subprocess .run (
140140 cmd ,
141141 universal_newlines = True ,
@@ -157,7 +157,7 @@ def _install_galaxy_role() -> None:
157157 if not os .path .exists ("meta/main.yml" ):
158158 return
159159 yaml = yaml_from_file ("meta/main.yml" )
160- if 'galaxy_info' not in ' yaml' :
160+ if 'galaxy_info' not in yaml :
161161 return
162162 role_name = yaml ['galaxy_info' ].get ('role_name' , None )
163163 role_author = yaml ['galaxy_info' ].get ('author' , None )
@@ -170,8 +170,14 @@ def _install_galaxy_role() -> None:
170170 p = pathlib .Path (".cache/roles" )
171171 p .mkdir (parents = True , exist_ok = True )
172172 link_path = p / f"{ role_author } .{ role_name } "
173- if not link_path .exists :
173+ # despite documentation stating that is_file() reports true for symlinks,
174+ # it appears that is_dir() reports true instead, so we rely on exits().
175+ if not link_path .exists ():
174176 link_path .symlink_to (pathlib .Path ("../.." , target_is_directory = True ))
177+ print (
178+ f"Using { link_path } symlink to current repository in order to enable Ansible to find the role using its expected full name." ,
179+ file = sys .stderr ,
180+ )
175181
176182
177183def _prepare_ansible_paths () -> None :
0 commit comments