Skip to content

Commit dc8ad59

Browse files
committed
Fix for python 3 / Splunk 8
1 parent b16be24 commit dc8ad59

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,9 @@ To do this you will need to install Version Control For SplunkCloud on your Splu
260260
[SplunkVersionControlCloud github](https://github.com/gjanders/SplunkVersionControlCloud)
261261

262262
## Release Notes
263+
### 1.1.2
264+
Found a bug that stops this running on Splunk 8 / python 3
265+
263266
### 1.1.1
264267
Corrected useLocalAuth setting so that it works as expected
265268

SplunkVersionControl.tgz

17 Bytes
Binary file not shown.

bin/splunkversioncontrol_backup_class.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -369,9 +369,9 @@ def runQueries(self, app, endpoint, type, fieldIgnoreList, aliasAttributes={}, v
369369
logger.info("i=\"%s\" Recording name=\"%s\" info for type=%s in app context app=%s with owner=%s" % (self.stanzaName, info["name"], type, app, info["owner"]))
370370

371371
logger.debug("Updated time is updated=%s" % (updated))
372-
epochUpdatedTime = long((self.determineTime(updated) - datetime(1970,1,1)).total_seconds())
372+
epochUpdatedTime = int((self.determineTime(updated) - datetime(1970,1,1)).total_seconds())
373373
logger.debug("epochUpdatedTime=%s" % (epochUpdatedTime))
374-
if self.lastRunEpoch == None or long(self.lastRunEpoch) <= epochUpdatedTime:
374+
if self.lastRunEpoch == None or int(self.lastRunEpoch) <= epochUpdatedTime:
375375
logger.info("i=\"%s\" name=\"%s\" of type=%s in app context app=%s with owner=%s was updated at %s updated=true" % (self.stanzaName, info["name"], type, app, info["owner"], updated))
376376
logger.debug("i=\"%s\" name=\"%s\" of type=%s in app context app=%s with owner=%s was updated at %s or epoch of %s compared to lastRunEpoch of %s" % (self.stanzaName, info["name"], type, app, info["owner"], updated, epochUpdatedTime, self.lastRunEpoch))
377377
creationSuccess.append(info["name"])
@@ -398,7 +398,7 @@ def runQueries(self, app, endpoint, type, fieldIgnoreList, aliasAttributes={}, v
398398
if not os.path.isdir(appLevelStorageDir):
399399
os.mkdir(appLevelStorageDir)
400400
with open(appLevelStorageDir + "/" + type, 'w', encoding="utf-8") as f:
401-
f.write(six.text_type(json.dumps(infoList["app"], f, sort_keys=True)))
401+
f.write(six.text_type(json.dumps(infoList["app"], sort_keys=True)))
402402
if "user" in infoList:
403403
#persist user level to disk
404404
userLevelStorageDir = appStorageDir + "/user"
@@ -530,8 +530,8 @@ def macros(self, app):
530530
del macroInfo["updated"]
531531

532532
logger.debug("Updated time is updated=%s" % (updated))
533-
epochUpdatedTime = long((self.determineTime(updated) - datetime(1970,1,1)).total_seconds())
534-
if self.lastRunEpoch == None or long(self.lastRunEpoch) <= epochUpdatedTime:
533+
epochUpdatedTime = int((self.determineTime(updated) - datetime(1970,1,1)).total_seconds())
534+
if self.lastRunEpoch == None or int(self.lastRunEpoch) <= epochUpdatedTime:
535535
logger.info("i=\"%s\" name=\"%s\" of type=macro in app context app=%s with owner=%s was updated at %s updated=true" % (self.stanzaName, macroInfo["name"], app, owner, updated))
536536
logger.debug("i=\"%s\" name=\"%s\" of type=macro in app context app=%s with owner=%s was updated at %s or epoch of %s compared to lastRunEpoch of %s" % (self.stanzaName, macroInfo["name"], app, owner, updated, epochUpdatedTime, self.lastRunEpoch))
537537
logger.info("i=\"%s\" Recording macro info for name=\"%s\" in app=%s with owner=%s sharing=%s" % (self.stanzaName, macroInfo["name"], app, macroInfo["owner"], macroInfo["sharing"]))

default/app.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ label = SplunkVersionControl
1212
[launcher]
1313
author = Gareth Anderson
1414
description = Version Control software for Splunk instances (backup/restore from git)
15-
version = 1.1.1
15+
version = 1.1.2
1616

1717
[package]
1818
id = SplunkVersionControl

0 commit comments

Comments
 (0)