def exec(bossman: Bossman, glob, *args, **kwargs): resources = bossman.get_resources(glob=glob) if len(resources): table = Table() table.add_column("Resource") table.add_column("Validation") for resource in resources: try: bossman.validate(resource) status = ":thumbs_up:" except: status = ":thumbs_down:" table.add_row( resource, status, ) print(table) else: print( "No resources to show: check the glob pattern if provided, or the configuration." )
def exec(bossman: Bossman, glob, *args, **kwargs): resources = bossman.get_resources_from_working_copy(*glob) if len(resources): table = Table() table.add_column("Resource") table.add_column("Validation") table.add_column("Error") for resource in resources: error = "" try: bossman.validate(resource) status = ":thumbs_up:" except BossmanValidationError as e: status = ":thumbs_down:" error = e table.add_row(resource, status, error) print(table) else: print( "No resources to show: check the glob pattern if provided, or the configuration." )