threefoldtecharchive / 0-robot

Distributed live cycle management system
Apache License 2.0
0 stars 0 forks source link

Checking out branch with renamed/removed directories throws errors #14

Open rkhamis opened 6 years ago

rkhamis commented 6 years ago

Issue migrated from [https://api.github.com/repos/zero-os/0-robot/issues/225](), opened by @chrisvdg

When checking out to a branch that results in removal (or moving) of templates, git leaves the old directory there and just removes the files that were inside. Then when importing the new templates, 0-robot complains that a template folder doesn't contain the template logic file.

# checking out to master to update the templates
In [27]: robot.templates.checkout_repo("https://github.com/zero-os/0-templates.git", "master")
---------------------------------------------------------------------------
HTTPError ...
...
RepoCheckoutError: [Errno 2] No such file or directory: '/opt/code/github/zero-os/0-templates/templates/network/network.py': 500 Server Error: INTERNAL SERVER ERROR for url: http://192.168.192.22:6600/templates

Suggestions to fix: