Skip to content

Commit

Permalink
Merge pull request #146 from cf-platform-eng/pr-skip-configure-valida…
Browse files Browse the repository at this point in the history
…tion

Add flag to skip pcf configure's validation
  • Loading branch information
mboldt authored Oct 25, 2016
2 parents 75dc500 + 263abfc commit 71c3d19
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tile_generator/opsmgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def get_job_guid(job_identifier, jobs_settings):
print('Could not find job with identifier', job_identifier, file=sys.stderr)
sys.exit(1)

def configure(product, properties, strict=False):
def configure(product, properties, strict=False, skip_validation=False):
settings = get('/api/installation_settings').json()
infrastructure = settings['infrastructure']
product_settings = [ p for p in settings['products'] if p['identifier'] == product ]
Expand Down Expand Up @@ -286,7 +286,7 @@ def configure(product, properties, strict=False):
else:
if p.get('value', None) is None:
missing_properties += [ key ]
if len(missing_properties) > 0:
if not skip_validation and len(missing_properties) > 0:
print('Input file is missing required properties:', file=sys.stderr)
print('- ' + '\n- '.join(missing_properties), file=sys.stderr)
sys.exit(1)
Expand Down
5 changes: 3 additions & 2 deletions tile_generator/pcf.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,13 @@ def is_installed_cmd(product, version):
@click.argument('product')
@click.argument('properties_file', None, required=False)
@click.option('--strict', is_flag=True)
def configure_cmd(product, properties_file, strict=False):
@click.option('--skip-validation', is_flag=True)
def configure_cmd(product, properties_file, strict=False, skip_validation=False):
properties = {}
if properties_file is not None:
with open(properties_file) as f:
properties = yaml.safe_load(f)
opsmgr.configure(product, properties, strict)
opsmgr.configure(product, properties, strict, skip_validation)

@cli.command('settings')
@click.argument('product', None, required=False)
Expand Down

0 comments on commit 71c3d19

Please sign in to comment.