~xnox/ubuntu-archive-tools/built-using

« back to all changes in this revision

Viewing changes to manage-builders

  • Committer: Colin Watson
  • Date: 2016-03-03 15:00:14 UTC
  • Revision ID: cjwatson@canonical.com-20160303150014-i9kxdpk58uiy0gy5
manage-builders: add --set-virtual and --set-non-virtual options

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
    List and manage Launchpad builders.
54
54
 
55
55
    If no changes are specified (--auto, --manual, --enable, --disable,
56
 
    --set-failnotes or --set-vm-host), a detailed listing of matching
57
 
    builders will be shown.
 
56
    --set-failnotes, --set-virtual, --set-non-virtual, or --set-vm-host), a
 
57
    detailed listing of matching builders will be shown.
58
58
    """))
59
59
parser.add_option(
60
60
    "-l", "--lp-instance", dest="lp_instance", default="production",
108
108
    "--set-failnotes", dest="set_failnotes", default=None,
109
109
    help="set the builder's failnotes")
110
110
parser.add_option(
 
111
    "--set-virtual", dest="set_virtual", action="store_true", default=None,
 
112
    help="mark the builder as virtual")
 
113
parser.add_option(
 
114
    "--set-non-virtual", dest="set_non_virtual",
 
115
    action="store_true", default=None,
 
116
    help="mark the builder as non-virtual")
 
117
parser.add_option(
111
118
    "--set-vm-host", dest="set_vm_host", default=None,
112
119
    help="set the builder's VM host")
113
120
 
121
128
    parser.error("--manual and --auto are mutually exclusive")
122
129
if options.enable and options.disable:
123
130
    parser.error("--enable and --disable are mutually exclusive")
 
131
if options.set_virtual and options.set_non_virtual:
 
132
    parser.error("--set-virtual and --set-non-virtual are mutually exclusive")
124
133
 
125
134
changes = {}
126
135
if options.manual:
133
142
    changes['builderok'] = False
134
143
if options.set_failnotes is not None:
135
144
    changes['failnotes'] = options.set_failnotes or None
 
145
if options.set_virtual:
 
146
    changes['virtualized'] = True
 
147
if options.set_non_virtual:
 
148
    changes['virtualized'] = False
136
149
if options.set_vm_host is not None:
137
150
    changes['vm_host'] = options.set_vm_host or None
138
151