Skip to content

Commit 1d99a41

Browse files
committed
Updates to splunkversioncontrol_backup_class.py:
- Added retry logic - Renamed `type` to `obj_type` to avoid clashes with the builtin python type - Added logic to remove default entries for savedsearches when backing up (this can reduce the display.visualization entries in some cases) - The code now triggers an exit with a particular exit code depending where the failure occurs Updated Splunk python SDK to 2.1.1
1 parent 49433b3 commit 1d99a41

29 files changed

Lines changed: 2092 additions & 1314 deletions

‎README.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,15 @@ As of October 2022, there are still no signs of version control within the Splun
326326
- [Search Head Backup](https://splunkbase.splunk.com/app/6438) - backup to an index, works in Splunk Cloud
327327

328328
## Release Notes
329+
### 1.2.17
330+
Updates to `splunkversioncontrol_backup_class.py`:
331+
- Added retry logic
332+
- Renamed `type` to `obj_type` to avoid clashes with the builtin python type
333+
- Added logic to remove default entries for savedsearches when backing up (this can reduce the display.visualization entries in some cases)
334+
- The code now triggers an exit with a particular exit code depending where the failure occurs
335+
336+
Updated Splunk python SDK to 2.1.1
337+
329338
### 1.2.16
330339
- `splunkversioncontrol_backup_class.py` - added "embed.expiry" to ignoreList (due to reports of issues in dashboards in new versions of Splunk cloud)
331340

‎bin/splunkversioncontrol_backup_class.py‎

Lines changed: 141 additions & 74 deletions
Large diffs are not rendered by default.

‎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.2.16
15+
version = 1.2.17
1616

1717
[package]
1818
id = SplunkVersionControl

‎lib/splunklib/__init__.py‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,21 @@
1616

1717
import logging
1818

19-
DEFAULT_LOG_FORMAT = '%(asctime)s, Level=%(levelname)s, Pid=%(process)s, Logger=%(name)s, File=%(filename)s, ' \
20-
'Line=%(lineno)s, %(message)s'
21-
DEFAULT_DATE_FORMAT = '%Y-%m-%d %H:%M:%S %Z'
19+
DEFAULT_LOG_FORMAT = (
20+
"%(asctime)s, Level=%(levelname)s, Pid=%(process)s, Logger=%(name)s, File=%(filename)s, "
21+
"Line=%(lineno)s, %(message)s"
22+
)
23+
DEFAULT_DATE_FORMAT = "%Y-%m-%d %H:%M:%S %Z"
2224

2325

2426
# To set the logging level of splunklib
2527
# ex. To enable debug logs, call this method with parameter 'logging.DEBUG'
2628
# default logging level is set to 'WARNING'
27-
def setup_logging(level, log_format=DEFAULT_LOG_FORMAT, date_format=DEFAULT_DATE_FORMAT):
28-
logging.basicConfig(level=level,
29-
format=log_format,
30-
datefmt=date_format)
29+
def setup_logging(
30+
level, log_format=DEFAULT_LOG_FORMAT, date_format=DEFAULT_DATE_FORMAT
31+
):
32+
logging.basicConfig(level=level, format=log_format, datefmt=date_format)
3133

3234

33-
__version_info__ = (2, 1, 0)
35+
__version_info__ = (2, 1, 1)
3436
__version__ = ".".join(map(str, __version_info__))

0 commit comments

Comments
 (0)