Google Groups

Re: Git Clone succeeds but salt thinks it fails


Jeff Schroeder Apr 24, 2012 6:56 PM
Posted in group: Salt-users
The error is from /usr/bin/git.

Try adding /.git to the end of your unless and see if that works?

Sent from my iPhone

On Apr 24, 2012, at 17:56, Andres Douglas <andres....@gmail.com> wrote:

> I have the following cmd in my state file
>
> git_clone:
>     cmd:
>         - run
>         - user: django
>         - name: git clone git@github:[..].git {{ deploy_path }}/{{ timestamp }}
>         - mkdirs: True
>         - unless: test -d {{ deploy_path }}/{{ timestamp }}
>
> (deploy_path/timestamp does not exist before I run it)
> Although it DOES clone the repo just fine,  salt thinks it fails with the following message:
>
> minion04.example.com:
> ----------
>     State: - cmd
>     Name:      git clone git@github:[..].git /var/django/[..]/20120425004839
>     Function:  run
>         Result:    False
>         Comment:   Command "git clone git@github:[..].git /var/django/[...]/revisions/20120425004839" run
>         Changes:   pid: 12051
>                    retcode: 128
>                    stderr: fatal: destination path '/var/django/[...]/revisions/20120425004839' already exists and is not an empty directory.
>                    stdout:
>
> I was ignoring this but now that I'm requiring this command to create a virtualenv I can ignore it no more. Any ideas?