This repository was archived by the owner on Jul 16, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed
Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change 44
55setup (
66 name = 'tgt_grease' ,
7- version = '2.3.8 ' ,
7+ version = '2.3.9 ' ,
88 license = "MIT" ,
99 description = 'Modern distributed automation engine built with love by Target' ,
1010 long_description = """
Original file line number Diff line number Diff line change 99class GreaseContainer (object ):
1010 """Inversion of Control Container for objects in GREASE"""
1111
12- __logger = Logging ()
13- __mongo = None
14-
15-
1612 def __init__ (self , * args , ** kwargs ):
1713 if args or kwargs :
1814 self .getLogger ().warning (
1915 "Passing instances of Logger to the IOC is deprecated. Please just use getLogger()." , verbose = True
2016 )
17+ self .__logger = None
18+ self .__mongo = None
2119
2220 def getLogger (self ):
2321 """Get the logging instance
@@ -27,7 +25,10 @@ def getLogger(self):
2725
2826 """
2927
30- return GreaseContainer .__logger
28+ if not isinstance (self .__logger , Logging ):
29+ self .__logger = Logging ()
30+
31+ return self .__logger
3132
3233 def getNotification (self ):
3334 """Get the notifications instance
@@ -45,9 +46,11 @@ def getMongo(self):
4546 Mongo: Mongo Instance Connection
4647
4748 """
48- if not GreaseContainer .__mongo :
49- GreaseContainer .__mongo = Mongo (self .getLogger ().getConfig ())
50- return GreaseContainer .__mongo
49+
50+ if not isinstance (self .__mongo , Mongo ):
51+ self .__mongo = Mongo (self .getLogger ().getConfig ())
52+
53+ return self .__mongo
5154
5255 def getCollection (self , collectionName ):
5356 """Get a collection object from MongoDB
You can’t perform that action at this time.
0 commit comments