File tree Expand file tree Collapse file tree 2 files changed +16
-25
lines changed Expand file tree Collapse file tree 2 files changed +16
-25
lines changed Original file line number Diff line number Diff line change @@ -109,21 +109,26 @@ def collect(self):
109
109
self .output = mp .Queue ()
110
110
111
111
if self .client :
112
- running_containers = self .client .containers (filters = {'status' : 'running' })
113
-
114
- processes = [mp .Process (target = self .collect_container_data , args = (x ,)) for x in running_containers ]
115
112
116
- # Run processes
117
- for p in processes :
118
- p .start ()
113
+ try :
114
+ running_containers = self .client .containers (filters = {'status' : 'running' })
115
+ except :
116
+ running_containers = False
117
+
118
+ if running_containers :
119
+ processes = [mp .Process (target = self .collect_container_data , args = (x ,)) for x in running_containers ]
120
+
121
+ # Run processes
122
+ for p in processes :
123
+ p .start ()
119
124
120
- # Exit the completed processes
121
- for p in processes :
122
- p .join ()
125
+ # Exit the completed processes
126
+ for p in processes :
127
+ p .join ()
123
128
124
129
125
- # Get process results from the output queue
126
- result = [self .output .get () for p in processes ]
130
+ # Get process results from the output queue
131
+ result = [self .output .get () for p in processes ]
127
132
128
133
129
134
return result
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments