summaryrefslogtreecommitdiff
path: root/ironic/db
diff options
context:
space:
mode:
authorYolanda Robla <yroblamo@redhat.com>2018-07-25 17:40:21 +0200
committerYolanda Robla <yroblamo@redhat.com>2018-08-20 10:25:24 +0200
commit94f0cedc98a1e21442633906a43c83b33b7c8702 (patch)
tree809d37d3185b25b4052f1dfcc776635e743a45af /ironic/db
parentc542b1b69e88fb35bfc230b695b57fb7085d274a (diff)
downloadironic-94f0cedc98a1e21442633906a43c83b33b7c8702.tar.gz
Add automated_clean field
This field will define if the automated clean will be enabled on the node. The default will be true, so when automated cleanup is enabled generally, all the nodes will be cleaned. If some node needs to be skipped, automated_cleanup needs to be change to False. Change-Id: I47f4c4097f849472be54d2be81e1440b8f349edb Story: #2002161 Task: #20011
Diffstat (limited to 'ironic/db')
-rw-r--r--ironic/db/sqlalchemy/alembic/versions/d2b036ae9378_add_automated_clean_field.py31
-rw-r--r--ironic/db/sqlalchemy/models.py1
2 files changed, 32 insertions, 0 deletions
diff --git a/ironic/db/sqlalchemy/alembic/versions/d2b036ae9378_add_automated_clean_field.py b/ironic/db/sqlalchemy/alembic/versions/d2b036ae9378_add_automated_clean_field.py
new file mode 100644
index 000000000..30a16108b
--- /dev/null
+++ b/ironic/db/sqlalchemy/alembic/versions/d2b036ae9378_add_automated_clean_field.py
@@ -0,0 +1,31 @@
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+"""Add automated_clean field
+
+Revision ID: d2b036ae9378
+Revises: 664f85c2f622
+Create Date: 2018-07-25 15:30:20.860792
+
+"""
+
+from alembic import op
+import sqlalchemy as sa
+
+# revision identifiers, used by Alembic.
+revision = 'd2b036ae9378'
+down_revision = '664f85c2f622'
+
+
+def upgrade():
+ op.add_column('nodes', sa.Column('automated_clean', sa.Boolean(),
+ nullable=True))
diff --git a/ironic/db/sqlalchemy/models.py b/ironic/db/sqlalchemy/models.py
index a94e9645c..70dafcc50 100644
--- a/ironic/db/sqlalchemy/models.py
+++ b/ironic/db/sqlalchemy/models.py
@@ -175,6 +175,7 @@ class Node(Base):
inspection_finished_at = Column(DateTime, nullable=True)
inspection_started_at = Column(DateTime, nullable=True)
extra = Column(db_types.JsonEncodedDict)
+ automated_clean = Column(Boolean, nullable=True)
bios_interface = Column(String(255), nullable=True)
boot_interface = Column(String(255), nullable=True)