-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replaces eval() with ast.literal_eval()
- Loading branch information
Showing
9 changed files
with
14 additions
and
18 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,11 +6,11 @@ | |
# Robert Sander <[email protected]> | ||
# | ||
|
||
import argparse | ||
import argparse # type: ignore | ||
import checkmkapi | ||
import re | ||
import copy | ||
from pprint import pprint | ||
import re # type: ignore | ||
from ast import literal_eval # type: ignore | ||
from pprint import pprint # type: ignore | ||
|
||
def get_host_labels(hostname): | ||
host, etag = wato.get_host(hostname) | ||
|
@@ -34,7 +34,7 @@ def get_host_labels(hostname): | |
parser.add_argument('-d', '--dump', action="store_true", help='Dump unique values from the view') | ||
args = parser.parse_args() | ||
|
||
conf = eval(open(args.config, 'r').read()) | ||
conf = literal_eval(open(args.config, 'r').read()) | ||
conf_labelmap = {} | ||
for attr, patterns in conf['labelmap'].items(): | ||
conf_labelmap[attr] = {} | ||
|
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,11 +6,11 @@ | |
# Robert Sander <[email protected]> | ||
# | ||
|
||
import argparse | ||
import argparse # type: ignore | ||
import checkmkapi | ||
import re | ||
import copy | ||
from pprint import pprint | ||
import re # type: ignore | ||
from ast import literal_eval # type: ignore | ||
from pprint import pprint # type: ignore | ||
|
||
parser = argparse.ArgumentParser() | ||
parser.add_argument('-s', '--url', help='URL to Check_MK site') | ||
|
@@ -20,7 +20,7 @@ | |
parser.add_argument('-d', '--dump', action="store_true", help='Dump unique values from the view') | ||
args = parser.parse_args() | ||
|
||
conf = eval(open(args.config, 'r').read()) | ||
conf = literal_eval(open(args.config, 'r').read()) | ||
conf_tagmap = {} | ||
for attr, patterns in conf['tagmap'].items(): | ||
conf_tagmap[attr] = {} | ||
|
Binary file not shown.
Binary file not shown.