File tree Expand file tree Collapse file tree 4 files changed +6
-5
lines changed Expand file tree Collapse file tree 4 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ def __init__(self, configuration):
91
91
92
92
logger .setLevel (logging .DEBUG )
93
93
94
- self .server_url = self .configuration [ "server" ]
94
+ self .server_url = self .configuration . get ( "server" , "" )
95
95
if self .server_url [- 1 ] == "/" :
96
96
self .server_url = self .server_url [:- 1 ]
97
97
Original file line number Diff line number Diff line change @@ -188,7 +188,7 @@ def __init__(self, configuration):
188
188
189
189
self .syntax = "json"
190
190
191
- self .db_name = self .configuration [ "dbName" ]
191
+ self .db_name = self .configuration . get ( "dbName" , "" )
192
192
193
193
self .is_replica_set = (
194
194
True if "replicaSetName" in self .configuration and self .configuration ["replicaSetName" ] else False
Original file line number Diff line number Diff line change @@ -55,12 +55,13 @@ def type(cls):
55
55
def __init__ (self , configuration ):
56
56
super (Script , self ).__init__ (configuration )
57
57
58
+ path = self .configuration .get ("path" , "" )
58
59
# If path is * allow any execution path
59
- if self . configuration [ " path" ] == "*" :
60
+ if path == "*" :
60
61
return
61
62
62
63
# Poor man's protection against running scripts from outside the scripts directory
63
- if self . configuration [ " path" ] .find ("../" ) > - 1 :
64
+ if path .find ("../" ) > - 1 :
64
65
raise ValueError ("Scripts can only be run from the configured scripts directory" )
65
66
66
67
def test_connection (self ):
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ def type(cls):
28
28
def __init__ (self , configuration ):
29
29
super (Sqlite , self ).__init__ (configuration )
30
30
31
- self ._dbpath = self .configuration [ "dbpath" ]
31
+ self ._dbpath = self .configuration . get ( "dbpath" , "" )
32
32
33
33
def _get_tables (self , schema ):
34
34
query_table = "select tbl_name from sqlite_master where type='table'"
You can’t perform that action at this time.
0 commit comments