|
17 | 17 | class FunctionRunner(grpcv1.FunctionRunnerService): |
18 | 18 | """A FunctionRunner handles gRPC RunFunctionRequests.""" |
19 | 19 |
|
20 | | - def __init__(self, debug=False, renderUnknowns=False, crossplane_v1=False): |
| 20 | + def __init__(self, renderUnknowns=False, crossplane_v1=False): |
21 | 21 | """Create a new FunctionRunner.""" |
22 | | - self.debug = debug |
23 | 22 | self.renderUnknowns = renderUnknowns |
24 | 23 | self.crossplane_v1 = crossplane_v1 |
25 | 24 | self.clazzes = {} |
@@ -182,7 +181,7 @@ def process_usages(self, composite): |
182 | 181 | for _, resource in sorted(entry for entry in composite.resources): |
183 | 182 | dependencies = resource.desired._getDependencies |
184 | 183 | if dependencies: |
185 | | - if self.debug: |
| 184 | + if composite.logger.isEnabledFor(logging.DEBUG): |
186 | 185 | for destination, source in sorted(dependencies.items()): |
187 | 186 | destination = self.trimFullName(destination) |
188 | 187 | source = self.trimFullName(source) |
@@ -278,7 +277,7 @@ def process_unknowns(self, composite): |
278 | 277 | if resource.unknownsFatal or (resource.unknownsFatal is None and composite.unknownsFatal): |
279 | 278 | fatalResources.append(name) |
280 | 279 | fatal = True |
281 | | - if self.debug: |
| 280 | + if composite.logger.isEnabledFor(logging.DEBUG): |
282 | 281 | for destination, source in sorted(unknowns.items()): |
283 | 282 | destination = self.trimFullName(destination) |
284 | 283 | source = self.trimFullName(source) |
@@ -319,7 +318,7 @@ def process_unknowns(self, composite): |
319 | 318 | message = 'All resources are composed' |
320 | 319 | status = True |
321 | 320 | result = None |
322 | | - if not self.debug and level: |
| 321 | + if not composite.logger.isEnabledFor(logging.DEBUG) and level: |
323 | 322 | level(message) |
324 | 323 | composite.conditions.ResourcesComposed(reason, message, status) |
325 | 324 | if result: |
@@ -378,6 +377,7 @@ def __init__(self): |
378 | 377 | self.List = pythonic.List |
379 | 378 | self.Unknown = pythonic.Unknown |
380 | 379 | self.Yaml = pythonic.Yaml |
| 380 | + self.YamlAll = pythonic.YamlAll |
381 | 381 | self.Json = pythonic.Json |
382 | 382 | self.B64Encode = pythonic.B64Encode |
383 | 383 | self.B64Decode = pythonic.B64Decode |
0 commit comments