Git Clone succeeds but salt thinks it fails

81 views
Skip to first unread message

Andres Douglas

unread,
Apr 24, 2012, 8:56:34 PM4/24/12
to salt-...@googlegroups.com
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:

----------
    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?

Jeff Schroeder

unread,
Apr 24, 2012, 9:56:28 PM4/24/12
to salt-...@googlegroups.com, salt-...@googlegroups.com
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

Andres Douglas

unread,
Apr 24, 2012, 11:34:33 PM4/24/12
to salt-...@googlegroups.com
Nah, that doesn't work. What's the rationale behind that? Without knowing much about the internals, It seems like the git clone cmd is running twice. Is that possible?

Thomas S Hatch

unread,
Apr 25, 2012, 12:59:25 AM4/25/12
to salt-...@googlegroups.com
I doubt it is running twice, unless you are running Salt 0.9.2 and invoking a very hard to find bug. What we really need is to finish up the vcs states and get they in there, we have the demand. I might take a look at it after I take care of a few bugs

Andres Douglas

unread,
Apr 25, 2012, 12:09:22 PM4/25/12
to salt-...@googlegroups.com
I'm running 0.9.8. VCS states would certainly be ideal, but just getting a hacked up version would work in the meantime. In the meantime Is there any other info I can provide that might be helpful in diagnosing?
Reply all
Reply to author
Forward
0 new messages