summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Peck <bpeck@redhat.com>2011-02-01 12:08:55 -0500
committerBill Peck <bpeck@redhat.com>2011-02-01 13:20:17 -0500
commit56a3ed95c8b68aaa3bf0c8168f589d935a532de4 (patch)
tree66cc8656476c01be84330fd42f301f31a9b7f23d
parentf5ff4ab21d3a60f96cbc6076547bdcd45bff0592 (diff)
Allow lab controllers to be disabled.beaker-distribution-beaker-setup-1_1-4
Bug: bz560695
-rw-r--r--Server/bkr/server/labcontroller.py7
-rw-r--r--Server/bkr/server/model.py1
-rwxr-xr-xServer/bkr/server/tools/beakerd.py1
-rwxr-xr-xTasks/distribution/beaker/setup/add_labcontroller.py3
4 files changed, 10 insertions, 2 deletions
diff --git a/Server/bkr/server/labcontroller.py b/Server/bkr/server/labcontroller.py
index d737d95..7c103c3 100644
--- a/Server/bkr/server/labcontroller.py
+++ b/Server/bkr/server/labcontroller.py
@@ -38,10 +38,14 @@ class LabControllers(RPCRoot):
fqdn = widgets.TextField(name='fqdn', label=_(u'FQDN'))
username = widgets.TextField(name='username', label=_(u'Username'))
password = widgets.PasswordField(name='password', label=_(u'Password'))
+ disabled = widgets.CheckBox(name='disabled',
+ label=_(u'Disabled'),
+ default=False)
+
labcontroller_form = widgets.TableForm(
'LabController',
- fields = [id, fqdn, username, password],
+ fields = [id, fqdn, username, password, disabled],
action = 'save_data',
submit_text = _(u'Save'),
validator = LabControllerFormSchema()
@@ -80,6 +84,7 @@ class LabControllers(RPCRoot):
labcontroller.fqdn = kw['fqdn']
labcontroller.username = kw['username']
labcontroller.password = kw['password']
+ labcontroller.disabled = kw['disabled']
labcontroller.distros_md5 = '0.0'
flash( _(u"%s saved" % labcontroller.fqdn) )
diff --git a/Server/bkr/server/model.py b/Server/bkr/server/model.py
index ee34210..a7485b5 100644
--- a/Server/bkr/server/model.py
+++ b/Server/bkr/server/model.py
@@ -394,6 +394,7 @@ lab_controller_table = Table('lab_controller', metadata,
Column('password',Unicode(255)),
Column('distros_md5', String(40)),
Column('systems_md5', String(40)),
+ Column('disabled', Boolean, nullable=False, default=False),
mysql_engine='InnoDB',
)
diff --git a/Server/bkr/server/tools/beakerd.py b/Server/bkr/server/tools/beakerd.py
index 24446b4..455f3dc 100755
--- a/Server/bkr/server/tools/beakerd.py
+++ b/Server/bkr/server/tools/beakerd.py
@@ -270,6 +270,7 @@ def queued_recipes(*args):
systems = recipe.dyn_systems.join(['lab_controller','_distros','distro']).\
filter(and_(System.user==None,
Distro.id==recipe.distro_id,
+ LabController.disabled==False,
System.status==automated))
# Order systems by owner, then Group, finally shared for everyone.
# FIXME Make this configurable, so that a user can specify their scheduling
diff --git a/Tasks/distribution/beaker/setup/add_labcontroller.py b/Tasks/distribution/beaker/setup/add_labcontroller.py
index 7c8a327..2e21d4c 100755
--- a/Tasks/distribution/beaker/setup/add_labcontroller.py
+++ b/Tasks/distribution/beaker/setup/add_labcontroller.py
@@ -38,5 +38,6 @@ formclear(1)
fv("1","fqdn",labcontroller)
fv("1","username", "testing")
fv("1","password", "testing")
-submit('5')
+fv("1","disabled",False)
+submit('Save')
code(200)