Skip to content

Commit

Permalink
added --clear-resources option
Browse files Browse the repository at this point in the history
  • Loading branch information
advornic committed Jan 29, 2015
1 parent 799b798 commit 3e46f43
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ztpserver/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,14 +241,15 @@ def clear_resources(debug):
print '\nClearing resources...'
for resource in all_files(os.path.join(data_root,
'resources')):
print 'Clearing %s...' % resource
print 'Clearing %s...' % resource,
try:
contents = load(resource, CONTENT_TYPE_YAML,
'clear_resource')
for key in contents:
contents[key] = 'None'
dump(contents, resource, CONTENT_TYPE_YAML,
'clear_resource')
print 'Ok!'
except Exception as exc: #pylint: disable=W0703
print '\nERROR: Failed to clear %s\n%s' % \
(resource, exc)
Expand Down

0 comments on commit 3e46f43

Please sign in to comment.