MCPcopy Create free account
hub / github.com/airbnb/binaryalert / validate

Method validate

cli/config.py:263–282  ·  view source on GitHub ↗

Validate config values against their expected formats. Terraform and AWS have their own validation, but this simple up-front check saves the user some headache compared to waiting for a deploy to fail. We only explicitly validate variables which the user can change through t

(self)

Source from the content-addressed store, hash-verified

261 self.save()
262
263 def validate(self) -> None:
264 """Validate config values against their expected formats.
265
266 Terraform and AWS have their own validation, but this simple up-front check
267 saves the user some headache compared to waiting for a deploy to fail.
268 We only explicitly validate variables which the user can change through the CLI:
269 aws_region, name_prefix, *carbon_black*
270
271 Raises:
272 InvalidConfigError: If any config variable has an invalid value.
273 """
274 # Go through the internal setters which have the validation logic.
275 self.aws_account_id = self.aws_account_id
276 self.aws_region = self.aws_region
277 self.name_prefix = self.name_prefix
278 self.enable_carbon_black_downloader = self.enable_carbon_black_downloader
279 if self.enable_carbon_black_downloader:
280 # Validate CarbonBlack variables if applicable.
281 self.carbon_black_url = self.carbon_black_url
282 self.encrypted_carbon_black_api_token = self.encrypted_carbon_black_api_token
283
284 def save(self) -> None:
285 """Save the current configuration to the terraform.tfvars config file."""

Callers 4

test_validate_invalidMethod · 0.95
runMethod · 0.80

Calls

no outgoing calls