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):
9191
9292 logger .setLevel (logging .DEBUG )
9393
94- self .server_url = self .configuration [ "server" ]
94+ self .server_url = self .configuration . get ( "server" , "" )
9595 if self .server_url [- 1 ] == "/" :
9696 self .server_url = self .server_url [:- 1 ]
9797
Original file line number Diff line number Diff line change @@ -188,7 +188,7 @@ def __init__(self, configuration):
188188
189189 self .syntax = "json"
190190
191- self .db_name = self .configuration [ "dbName" ]
191+ self .db_name = self .configuration . get ( "dbName" , "" )
192192
193193 self .is_replica_set = (
194194 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):
5555 def __init__ (self , configuration ):
5656 super (Script , self ).__init__ (configuration )
5757
58+ path = self .configuration .get ("path" , "" )
5859 # If path is * allow any execution path
59- if self . configuration [ " path" ] == "*" :
60+ if path == "*" :
6061 return
6162
6263 # Poor man's protection against running scripts from outside the scripts directory
63- if self . configuration [ " path" ] .find ("../" ) > - 1 :
64+ if path .find ("../" ) > - 1 :
6465 raise ValueError ("Scripts can only be run from the configured scripts directory" )
6566
6667 def test_connection (self ):
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ def type(cls):
2929 def __init__ (self , configuration ):
3030 super (Sqlite , self ).__init__ (configuration )
3131
32- self ._dbpath = self .configuration [ "dbpath" ]
32+ self ._dbpath = self .configuration . get ( "dbpath" , "" )
3333
3434 def _get_tables (self , schema ):
3535 query_table = "select tbl_name from sqlite_master where type='table'"
You can’t perform that action at this time.
0 commit comments