Skip to content

Commit bbdc4df

Browse files
authored
Update splunkversioncontrol_backup_class.py
1 parent 63d9a9a commit bbdc4df

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bin/splunkversioncontrol_backup_class.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,7 @@ def run_script(self):
10511051
self.gitRootDir = config['gitTempDir']
10521052
dirExists = os.path.isdir(self.gitTempDir)
10531053
if dirExists and len(os.listdir(self.gitTempDir)) != 0:
1054-
if os.listdir(self.gitTempDir)[0] != ".git":
1054+
if not ".git" in os.listdir(self.gitTempDir):
10551055
#include the subdirectory which is the git repo
10561056
self.gitTempDir = self.gitTempDir + "/" + os.listdir(self.gitTempDir)[0]
10571057
logger.debug("gitTempDir=%s" % (self.gitTempDir))
@@ -1070,7 +1070,7 @@ def run_script(self):
10701070
sys.exit(1)
10711071
else:
10721072
logger.info("i=\"%s\" Successfully cloned the git URL from %s into directory %s" % (self.stanzaName, self.gitRepoURL, self.gitTempDir))
1073-
if os.listdir(self.gitTempDir)[0] != ".git":
1073+
if not ".git" in os.listdir(self.gitTempDir):
10741074
#include the subdirectory which is the git repo
10751075
self.gitTempDir = self.gitTempDir + "/" + os.listdir(self.gitTempDir)[0]
10761076
logger.debug("gitTempDir=%s" % (self.gitTempDir))

0 commit comments

Comments
 (0)