Merge lp:~negronjl/charm-tools/ignore-warnings-modified-force into lp:~charmers/charm-tools/trunk

Proposed by Juan L. Negron on 2012-05-23
Status: Merged
Approved by: Clint Byrum on 2012-05-23
Approved revision: 140
Merge reported by: Juan L. Negron
Merged at revision: not available
Proposed branch: lp:~negronjl/charm-tools/ignore-warnings-modified-force
Merge into: lp:~charmers/charm-tools/trunk
Diff against target: 37 lines (+14/-4)
1 file modified
scripts/promulgate (+14/-4)
To merge this branch: bzr merge lp:~negronjl/charm-tools/ignore-warnings-modified-force
Reviewer Review Type Date Requested Status
charmers 2012-05-23 Pending
Review via email: mp+107082@code.launchpad.net
To post a comment you must log in.
Juan L. Negron (negronjl) wrote :

Modified force to override and promulgate on both warnings and errors
Added ignore-warnings options to promulgate with warnings.

-Juan

Juan L. Negron (negronjl) wrote :

Merged

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'scripts/promulgate'
2--- scripts/promulgate 2012-05-19 00:30:02 +0000
3+++ scripts/promulgate 2012-05-23 17:24:19 +0000
4@@ -63,6 +63,9 @@
5 help='Un-promulgate this branch instead of promulgating it')
6 parser.add_option(
7 '-f', '--force', dest='force', action='store_true', default=False,
8+ help='Override warnings and errors. USE WITH EXTREME CARE !!!!')
9+ parser.add_option(
10+ '-w', '--ignore-warnings', dest='ignore-warnings', action='store_true', default=False,
11 help='Promulgate this branch even with warnings from charm proof')
12 options, args = parser.parse_args()
13
14@@ -82,12 +85,19 @@
15 print "Running charm proof ... "
16 charm_proof = subprocess.call(['charm', 'proof', charm_dir])
17 if charm_proof == 1 or charm_proof == 200:
18- sys.exit(1)
19- if charm_proof == 100 and options.force == True:
20- print "force option enabled ... Continuing with warnings"
21+ if options.force == True:
22+ print "force option enabled ... Continuing with errors"
23+ else:
24+ sys.exit(1)
25+ if charm_proof == 100:
26+ if options.ignore-warnings == True:
27+ print "ignore-warnings enabled ... Continuing with warnings"
28+ elif options.force == True:
29+ print "force option enabled ... Continuing with warnings"
30+ else:
31+ sys.exit(charm_proof)
32 if charm_proof == 0:
33 print "Excellent ... charm proof passed with flying colors"
34- sys.exit(0)
35
36 charm_metadata = os.path.join(charm_dir, 'metadata.yaml')
37 if not os.access(charm_metadata, os.R_OK):

Subscribers

People subscribed via source and target branches