Compare commits
10 Commits
19a5842b2a
...
cad912ebf2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cad912ebf2 | ||
|
|
e9ec1aa1fb | ||
|
|
dc73671d39 | ||
|
|
e6adaf39f0 | ||
|
|
34b5db652c | ||
|
|
f927962692 | ||
|
|
d12033c018 | ||
|
|
23b6950b72 | ||
|
|
d7f05e85fc | ||
|
|
b667cd539b |
98
Fix-jsonpatch-related-tests.patch
Normal file
98
Fix-jsonpatch-related-tests.patch
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
diff --git a/ironic/api/controllers/v1/utils.py b/ironic/api/controllers/v1/utils.py
|
||||||
|
index 2949325..5c13d2a 100644
|
||||||
|
--- a/ironic/api/controllers/v1/utils.py
|
||||||
|
+++ b/ironic/api/controllers/v1/utils.py
|
||||||
|
@@ -42,7 +42,8 @@ from ironic import objects
|
||||||
|
CONF = cfg.CONF
|
||||||
|
|
||||||
|
|
||||||
|
-_JSONPATCH_EXCEPTIONS = (jsonpatch.JsonPatchException,
|
||||||
|
+_JSONPATCH_EXCEPTIONS = (jsonpatch.JsonPatchConflict,
|
||||||
|
+ jsonpatch.JsonPatchException,
|
||||||
|
jsonpatch.JsonPointerException,
|
||||||
|
KeyError,
|
||||||
|
IndexError)
|
||||||
|
diff --git a/ironic/tests/unit/api/controllers/v1/test_deploy_template.py b/ironic/tests/unit/api/controllers/v1/test_deploy_template.py
|
||||||
|
index 049a21f..d30b763 100644
|
||||||
|
--- a/ironic/tests/unit/api/controllers/v1/test_deploy_template.py
|
||||||
|
+++ b/ironic/tests/unit/api/controllers/v1/test_deploy_template.py
|
||||||
|
@@ -361,7 +361,8 @@ class TestPatch(BaseDeployTemplatesAPITest):
|
||||||
|
self.assertEqual('application/json', response.content_type)
|
||||||
|
self.assertEqual(http_client.BAD_REQUEST, response.status_code)
|
||||||
|
self.assertTrue(response.json['error_message'])
|
||||||
|
- self.assertIn(error_msg, response.json['error_message'])
|
||||||
|
+ #self.assertIn(error_msg, response.json['error_message'])
|
||||||
|
+ self.assertRegex(response.json['error_message'], error_msg)
|
||||||
|
self.assertFalse(mock_save.called)
|
||||||
|
return response
|
||||||
|
|
||||||
|
@@ -539,7 +540,8 @@ class TestPatch(BaseDeployTemplatesAPITest):
|
||||||
|
}
|
||||||
|
patch = [{'path': '/steps/1', 'op': 'replace', 'value': step}]
|
||||||
|
self._test_update_bad_request(
|
||||||
|
- mock_save, patch, "list assignment index out of range")
|
||||||
|
+ mock_save, patch, "list assignment index out of range|"
|
||||||
|
+ "can't replace outside of list")
|
||||||
|
|
||||||
|
def test_replace_empty_step_list_fail(self, mock_save):
|
||||||
|
patch = [{'path': '/steps', 'op': 'replace', 'value': []}]
|
||||||
|
@@ -567,7 +569,7 @@ class TestPatch(BaseDeployTemplatesAPITest):
|
||||||
|
|
||||||
|
def test_remove_foo(self, mock_save):
|
||||||
|
self._test_remove_not_allowed(
|
||||||
|
- mock_save, 'foo', "can't remove non-existent object 'foo'")
|
||||||
|
+ mock_save, 'foo', "can't remove a non-existent object 'foo'")
|
||||||
|
|
||||||
|
def test_replace_step_invalid_interface(self, mock_save):
|
||||||
|
patch = [{'path': '/steps/0/interface', 'op': 'replace',
|
||||||
|
@@ -634,12 +636,12 @@ class TestPatch(BaseDeployTemplatesAPITest):
|
||||||
|
patch = [{'path': '/non-existent', 'op': 'remove'}]
|
||||||
|
self._test_update_bad_request(
|
||||||
|
mock_save, patch,
|
||||||
|
- "can't remove non-existent object 'non-existent'")
|
||||||
|
+ "can't remove a non-existent object 'non-existent'")
|
||||||
|
|
||||||
|
def test_remove_non_existent_step_fail(self, mock_save):
|
||||||
|
patch = [{'path': '/steps/1', 'op': 'remove'}]
|
||||||
|
self._test_update_bad_request(
|
||||||
|
- mock_save, patch, "can't remove non-existent object '1'")
|
||||||
|
+ mock_save, patch, "can't remove a non-existent object '1'")
|
||||||
|
|
||||||
|
def test_remove_only_step_fail(self, mock_save):
|
||||||
|
patch = [{'path': '/steps/0', 'op': 'remove'}]
|
||||||
|
@@ -650,12 +652,12 @@ class TestPatch(BaseDeployTemplatesAPITest):
|
||||||
|
patch = [{'path': '/steps/0/non-existent', 'op': 'remove'}]
|
||||||
|
self._test_update_bad_request(
|
||||||
|
mock_save, patch,
|
||||||
|
- "can't remove non-existent object 'non-existent'")
|
||||||
|
+ "can't remove a non-existent object 'non-existent'")
|
||||||
|
|
||||||
|
def test_add_root_non_existent(self, mock_save):
|
||||||
|
patch = [{'path': '/foo', 'value': 'bar', 'op': 'add'}]
|
||||||
|
self._test_update_bad_request(
|
||||||
|
- mock_save, patch, "Adding a new attribute (/foo)")
|
||||||
|
+ mock_save, patch, "Adding a new attribute \(/foo\)")
|
||||||
|
|
||||||
|
def test_add_too_high_index_step_fail(self, mock_save):
|
||||||
|
step = {
|
||||||
|
diff --git a/ironic/tests/unit/api/controllers/v1/test_utils.py b/ironic/tests/unit/api/controllers/v1/test_utils.py
|
||||||
|
index d18fded..1c7d842 100644
|
||||||
|
--- a/ironic/tests/unit/api/controllers/v1/test_utils.py
|
||||||
|
+++ b/ironic/tests/unit/api/controllers/v1/test_utils.py
|
||||||
|
@@ -105,7 +105,7 @@ class TestApiUtils(base.TestCase):
|
||||||
|
doc = {}
|
||||||
|
patch = [{"op": "remove", "path": "/foo"}]
|
||||||
|
self.assertRaisesRegex(exception.PatchError,
|
||||||
|
- "can't remove non-existent object 'foo'",
|
||||||
|
+ "can't remove a non-existent object 'foo'",
|
||||||
|
utils.apply_jsonpatch, doc, patch)
|
||||||
|
|
||||||
|
def test_apply_jsonpatch_replace_non_existent_list_item(self):
|
||||||
|
@@ -113,6 +113,7 @@ class TestApiUtils(base.TestCase):
|
||||||
|
doc = []
|
||||||
|
patch = [{"op": "replace", "path": "/0", "value": 42}]
|
||||||
|
self.assertRaisesRegex(exception.PatchError,
|
||||||
|
+ "can't replace outside of list|"
|
||||||
|
"list assignment index out of range",
|
||||||
|
utils.apply_jsonpatch, doc, patch)
|
||||||
|
|
||||||
BIN
ironic-13.0.7.tar.gz
Normal file
BIN
ironic-13.0.7.tar.gz
Normal file
Binary file not shown.
4
ironic-dist.conf
Normal file
4
ironic-dist.conf
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
[DEFAULT]
|
||||||
|
log_dir = /var/log/ironic
|
||||||
|
state_path = /var/lib/ironic
|
||||||
|
use_stderr = False
|
||||||
@ -1,2 +1,2 @@
|
|||||||
Defaults:ironic syslog_goodpri=none, !pam_session
|
Defaults:ironic !requiretty
|
||||||
ironic ALL = (root) NOPASSWD: /usr/bin/ironic-rootwrap /etc/ironic/rootwrap.conf *
|
ironic ALL = (root) NOPASSWD: /usr/bin/ironic-rootwrap /etc/ironic/rootwrap.conf *
|
||||||
Binary file not shown.
7
ironic.logrotate
Normal file
7
ironic.logrotate
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
/var/log/ironic/*.log {
|
||||||
|
rotate 14
|
||||||
|
size 10M
|
||||||
|
missingok
|
||||||
|
compress
|
||||||
|
copytruncate
|
||||||
|
}
|
||||||
@ -1,17 +1,13 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=OpenStack Ironic - API
|
Description=OpenStack Ironic API service
|
||||||
After=syslog.target network.target
|
After=syslog.target network.target
|
||||||
After=mariadb.service postgresql.service rabbitmq-server.service
|
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=notify
|
Type=simple
|
||||||
User=ironic
|
User=ironic
|
||||||
Group=ironic
|
|
||||||
WorkingDirectory=/var/lib/ironic
|
|
||||||
PrivateTmp=yes
|
|
||||||
ExecStartPre=-/usr/bin/ironic-dbsync
|
|
||||||
ExecStart=/usr/bin/ironic-api
|
ExecStart=/usr/bin/ironic-api
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
||||||
|
|||||||
@ -1,16 +1,13 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=OpenStack Ironic - Conductor
|
Description=OpenStack Ironic Conductor service
|
||||||
After=syslog.target network.target
|
After=syslog.target network.target
|
||||||
After=mariadb.service postgresql.service rabbitmq-server.service
|
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=notify
|
Type=simple
|
||||||
User=ironic
|
User=ironic
|
||||||
Group=ironic
|
|
||||||
WorkingDirectory=/var/lib/ironic
|
|
||||||
PrivateTmp=yes
|
|
||||||
ExecStart=/usr/bin/ironic-conductor
|
ExecStart=/usr/bin/ironic-conductor
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
||||||
|
|||||||
@ -1,30 +0,0 @@
|
|||||||
The main service configuration (/etc/$project/$project.conf) can still be used
|
|
||||||
for configuration but the preferred way is to add config file snippets into
|
|
||||||
/etc/$project/$project.conf.d/ instead.
|
|
||||||
|
|
||||||
As part of the packaging, the package itself installs a config snippet at
|
|
||||||
/etc/$project/$project.conf.d/010-$project.conf with basic configuration. This
|
|
||||||
file should not be modified. In case there is a need to overwrite or add
|
|
||||||
settings, a XXX-$project.conf (XXX being a 3 digit number) should be created
|
|
||||||
instead.
|
|
||||||
|
|
||||||
Config directory file snippet naming should follow these conventions:
|
|
||||||
- snippets should start with "XXX-" where "X" is a number
|
|
||||||
- snippets must end with ".conf"
|
|
||||||
- config management systems (Crowbar, Salt, ...) should use numbers
|
|
||||||
between 100 and 499
|
|
||||||
- users should use numbers starting from 500
|
|
||||||
|
|
||||||
Configuring just a single $program (eg for Nova, $project is "nova" and
|
|
||||||
$program is "nova-api", "nova-compute", "nova-scheduler", ...) can be done
|
|
||||||
in a similar way. The config snippets should be placed in
|
|
||||||
/etc/$project/$program.conf.d/ . The same snippets rules apply here, too.
|
|
||||||
|
|
||||||
$program reads the configuration files in the following order:
|
|
||||||
- /etc/$project/$project.conf
|
|
||||||
- /etc/$project/$project.conf.d/*.conf (lexically sorted)
|
|
||||||
- /etc/$project/$program.conf.d/*.conf (lexically sorted)
|
|
||||||
|
|
||||||
The last configured key overwrites all previous ones. In particular, settings
|
|
||||||
in /etc/$project/$project.conf are overwritten by config values from any file
|
|
||||||
in /etc/$project/$project.conf.d/XXX-$project.conf .
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
[DEFAULT]
|
|
||||||
log_dir = /var/log/ironic
|
|
||||||
rootwrap_config = /etc/ironic/rootwrap.conf
|
|
||||||
state_path = /var/lib/ironic
|
|
||||||
|
|
||||||
[oslo_concurrency]
|
|
||||||
lock_path = /run/ironic
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
/var/log/ironic/*.log {
|
|
||||||
compress
|
|
||||||
rotate 15
|
|
||||||
size 1M
|
|
||||||
dateext
|
|
||||||
missingok
|
|
||||||
notifempty
|
|
||||||
su ironic ironic
|
|
||||||
sharedscripts
|
|
||||||
}
|
|
||||||
@ -1,42 +1,51 @@
|
|||||||
%global with_doc 1
|
%global full_release ironic-%{version}
|
||||||
|
|
||||||
|
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
|
||||||
|
|
||||||
Name: openstack-ironic
|
Name: openstack-ironic
|
||||||
Epoch: 0
|
# Liberty semver reset
|
||||||
Version: 16.0.4
|
# https://review.openstack.org/#/q/I1a161b2c1d1e27268065b6b4be24c8f7a5315afb,n,z
|
||||||
Release: 0.2.dev3
|
Summary: OpenStack Baremetal Hypervisor API (ironic)
|
||||||
Summary: Openstack Provisioning of Bare Metal Servers
|
Version: 13.0.7
|
||||||
|
Release: 4
|
||||||
License: ASL 2.0
|
License: ASL 2.0
|
||||||
URL: https://launchpad.net/ironic
|
URL: http://www.openstack.org
|
||||||
Source0: ironic-stable-victoria.tar.gz
|
Source0: https://tarballs.openstack.org/ironic/ironic-%{version}.tar.gz
|
||||||
Source1: openstack-ironic.sudoers
|
|
||||||
Source2: openstack-ironic.logrotate
|
Source1: openstack-ironic-api.service
|
||||||
Source3: openstack-ironic.tmpfiles
|
Source2: openstack-ironic-conductor.service
|
||||||
Source4: openstack-ironic.defaultconf
|
Source3: ironic-rootwrap-sudoers
|
||||||
Source5: openstack-ironic.README.config
|
Source4: ironic-dist.conf
|
||||||
# systemd service files
|
Source5: ironic.logrotate
|
||||||
Source6: openstack-ironic-api.service
|
Patch0: Fix-jsonpatch-related-tests.patch
|
||||||
Source7: openstack-ironic-conductor.service
|
|
||||||
|
BuildArch: noarch
|
||||||
BuildRequires: openstack-macros
|
BuildRequires: openstack-macros
|
||||||
BuildRequires: python3-jinja2
|
BuildRequires: python3-setuptools
|
||||||
BuildRequires: python3-sqlalchemy
|
BuildRequires: python3-devel
|
||||||
BuildRequires: python3-wsme
|
BuildRequires: python3-pbr
|
||||||
BuildRequires: python3-webob
|
BuildRequires: openssl-devel
|
||||||
|
BuildRequires: libxml2-devel
|
||||||
|
BuildRequires: libxslt-devel
|
||||||
|
BuildRequires: gmp-devel
|
||||||
|
BuildRequires: python3-sphinx
|
||||||
|
BuildRequires: systemd
|
||||||
|
# Required to run unit tests
|
||||||
BuildRequires: python3-alembic
|
BuildRequires: python3-alembic
|
||||||
BuildRequires: python3-automaton
|
BuildRequires: python3-automaton
|
||||||
BuildRequires: python3-cinderclient
|
BuildRequires: python3-cinderclient
|
||||||
BuildRequires: python3-ddt
|
BuildRequires: python3-ddt
|
||||||
BuildRequires: python3-eventlet
|
BuildRequires: python3-eventlet
|
||||||
BuildRequires: python3-fixtures
|
|
||||||
BuildRequires: python3-futurist
|
BuildRequires: python3-futurist
|
||||||
BuildRequires: python3-glanceclient
|
BuildRequires: python3-glanceclient
|
||||||
BuildRequires: python3-ironic-lib
|
BuildRequires: python3-jinja2
|
||||||
BuildRequires: python3-iso8601
|
|
||||||
BuildRequires: python3-jsonpatch
|
BuildRequires: python3-jsonpatch
|
||||||
BuildRequires: python3-jsonschema
|
BuildRequires: python3-jsonschema
|
||||||
BuildRequires: python3-keystoneauth1
|
BuildRequires: python3-keystoneauth1
|
||||||
BuildRequires: python3-keystonemiddleware
|
BuildRequires: python3-keystonemiddleware
|
||||||
BuildRequires: python3-mock
|
BuildRequires: python3-mock
|
||||||
BuildRequires: python3-neutronclient
|
BuildRequires: python3-neutronclient
|
||||||
BuildRequires: python3-os-traits
|
BuildRequires: python3-openstacksdk
|
||||||
BuildRequires: python3-oslo-concurrency
|
BuildRequires: python3-oslo-concurrency
|
||||||
BuildRequires: python3-oslo-config
|
BuildRequires: python3-oslo-config
|
||||||
BuildRequires: python3-oslo-context
|
BuildRequires: python3-oslo-context
|
||||||
@ -55,266 +64,242 @@ BuildRequires: python3-oslo-utils
|
|||||||
BuildRequires: python3-oslo-versionedobjects
|
BuildRequires: python3-oslo-versionedobjects
|
||||||
BuildRequires: python3-oslotest
|
BuildRequires: python3-oslotest
|
||||||
BuildRequires: python3-osprofiler
|
BuildRequires: python3-osprofiler
|
||||||
|
BuildRequires: python3-os-traits
|
||||||
BuildRequires: python3-pbr
|
BuildRequires: python3-pbr
|
||||||
BuildRequires: python3-pecan
|
BuildRequires: python3-pecan
|
||||||
BuildRequires: python3-psutil
|
BuildRequires: python3-psutil
|
||||||
BuildRequires: python3-pysendfile
|
|
||||||
BuildRequires: python3-pysnmp
|
BuildRequires: python3-pysnmp
|
||||||
BuildRequires: python3-pytz
|
BuildRequires: python3-pytz
|
||||||
BuildRequires: python3-requests
|
BuildRequires: python3-requests
|
||||||
BuildRequires: python3-retrying
|
BuildRequires: python3-scciclient
|
||||||
BuildRequires: python3-rfc3986
|
BuildRequires: python3-sqlalchemy
|
||||||
BuildRequires: python3-stestr
|
BuildRequires: python3-stestr
|
||||||
BuildRequires: python3-stevedore
|
BuildRequires: python3-stevedore
|
||||||
|
BuildRequires: python3-sushy
|
||||||
BuildRequires: python3-swiftclient
|
BuildRequires: python3-swiftclient
|
||||||
|
BuildRequires: python3-testresources
|
||||||
|
BuildRequires: python3-testscenarios
|
||||||
BuildRequires: python3-testtools
|
BuildRequires: python3-testtools
|
||||||
BuildRequires: python3-tooz
|
BuildRequires: python3-tooz
|
||||||
BuildRequires: sudo
|
BuildRequires: python3-dracclient
|
||||||
Requires: logrotate
|
BuildRequires: python3-ironic-lib
|
||||||
Requires: python3-ironic = %{epoch}:%{version}-%{release}
|
BuildRequires: python3-proliantutils
|
||||||
BuildArch: noarch
|
BuildRequires: python3-tenacity
|
||||||
%if 0%{?suse_version}
|
BuildRequires: python3-webob
|
||||||
BuildRequires: systemd-rpm-macros
|
BuildRequires: python3-pysendfile
|
||||||
%{?systemd_requires}
|
BuildRequires: python3-wsme
|
||||||
%else
|
|
||||||
BuildRequires: systemd
|
Requires: %{name}-api = %{version}-%{release}
|
||||||
Requires(post): systemd
|
Requires: %{name}-conductor = %{version}-%{release}
|
||||||
Requires(postun): systemd
|
|
||||||
Requires(pre): shadow-utils
|
|
||||||
Requires(preun): systemd
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Ironic is an Incubated OpenStack project which aims to provision bare metal
|
Ironic provides an API for management and provisioning of physical machines
|
||||||
machines instead of virtual machines, forked from the Nova Baremetal driver.
|
|
||||||
It is best thought of as a bare metal hypervisor API and a set of plugins
|
|
||||||
which interact with the bare metal hypervisors. By default, it will use
|
|
||||||
PXE and IPMI in concert to provision and turn on/off machines, but Ironic
|
|
||||||
also supports vendor-specific plugins which may implement additional functionality.
|
|
||||||
|
|
||||||
%package -n python3-ironic
|
%package -n python3-ironic
|
||||||
Summary: OpenStack shared file system service (ironic) - Python module
|
Summary: OpenStack shared file system service (ironic) - Python module
|
||||||
Group: Development/Languages/Python
|
|
||||||
Requires: python3-jinja2
|
Requires: python3-alembic
|
||||||
Requires: python3-sqlalchemy
|
Requires: python3-automaton
|
||||||
Requires: python3-wsme
|
Requires: python3-cinderclient
|
||||||
Requires: python3-webob
|
Requires: python3-eventlet
|
||||||
Requires: python3-alembic
|
Requires: python3-futurist
|
||||||
Requires: python3-automaton
|
Requires: python3-glanceclient
|
||||||
Requires: python3-cinderclient
|
Requires: python3-ironic-lib
|
||||||
Requires: python3-eventlet
|
Requires: python3-jinja2
|
||||||
Requires: python3-futurist
|
Requires: python3-jsonpatch
|
||||||
Requires: python3-glanceclient
|
Requires: python3-jsonschema
|
||||||
Requires: python3-ironic-lib
|
Requires: python3-keystoneauth1
|
||||||
Requires: python3-jsonpatch
|
Requires: python3-keystonemiddleware
|
||||||
Requires: python3-jsonschema
|
Requires: python3-openstacksdk
|
||||||
Requires: python3-keystoneauth1
|
Requires: python3-oslo-concurrency
|
||||||
Requires: python3-keystonemiddleware
|
Requires: python3-oslo-config
|
||||||
Requires: python3-neutronclient
|
Requires: python3-oslo-context
|
||||||
Requires: python3-os-traits
|
Requires: python3-oslo-db
|
||||||
Requires: python3-oslo-concurrency
|
Requires: python3-oslo-log
|
||||||
Requires: python3-oslo-config
|
Requires: python3-oslo-messaging
|
||||||
Requires: python3-oslo-context
|
Requires: python3-oslo-middleware
|
||||||
Requires: python3-oslo-db
|
Requires: python3-oslo-policy
|
||||||
Requires: python3-oslo-i18n
|
Requires: python3-oslo-rootwrap
|
||||||
Requires: python3-oslo-log
|
Requires: python3-oslo-serialization
|
||||||
Requires: python3-oslo-messaging
|
Requires: python3-oslo-service
|
||||||
Requires: python3-oslo-middleware
|
Requires: python3-oslo-upgradecheck
|
||||||
Requires: python3-oslo-policy
|
Requires: python3-oslo-utils
|
||||||
Requires: python3-oslo-reports
|
Requires: python3-oslo-versionedobjects
|
||||||
Requires: python3-oslo-rootwrap
|
Requires: python3-osprofiler
|
||||||
Requires: python3-oslo-serialization
|
Requires: python3-os-traits
|
||||||
Requires: python3-oslo-service
|
Requires: python3-pbr
|
||||||
Requires: python3-oslo-upgradecheck
|
Requires: python3-pecan
|
||||||
Requires: python3-oslo-utils
|
Requires: python3-psutil
|
||||||
Requires: python3-oslo-versionedobjects
|
Requires: python3-pytz
|
||||||
Requires: python3-osprofiler
|
Requires: python3-requests
|
||||||
Requires: python3-pbr
|
Requires: python3-rfc3986
|
||||||
Requires: python3-pecan
|
Requires: python3-sqlalchemy
|
||||||
Requires: python3-psutil
|
Requires: python3-stevedore
|
||||||
Requires: python3-pysendfile
|
Requires: python3-swiftclient
|
||||||
Requires: python3-pysnmp
|
Requires: python3-tenacity
|
||||||
Requires: python3-pytz
|
Requires: python3-tooz
|
||||||
Requires: python3-requests
|
Requires: python3-webob
|
||||||
Requires: python3-retrying
|
Requires: python3-wsme
|
||||||
Requires: python3-rfc3986
|
Requires: python3-pysendfile
|
||||||
Requires: python3-stevedore
|
Requires(pre): shadow-utils
|
||||||
Requires: python3-swiftclient
|
|
||||||
Requires: python3-tooz
|
|
||||||
Requires: sudo
|
|
||||||
|
|
||||||
%description -n python3-ironic
|
%description -n python3-ironic
|
||||||
This package contains the core code of OpenStack Ironic.
|
This package contains the core code of OpenStack Ironic.
|
||||||
|
|
||||||
%if 0%{?with_doc}
|
%package common
|
||||||
%package doc
|
Summary: Ironic common
|
||||||
Summary: OpenStack bare metal provisioning service (ironic) - Documentation
|
Requires: python3-ironic = %{version}-%{release}
|
||||||
Group: Documentation/HTML
|
|
||||||
BuildRequires: python3-sphinx
|
|
||||||
BuildRequires: python3-openstackdocstheme
|
|
||||||
BuildRequires: python3-sphinxcontrib-apidoc
|
|
||||||
BuildRequires: python3-sphinxcontrib-httpdomain
|
|
||||||
BuildRequires: python3-sphinxcontrib-pecanwsme
|
|
||||||
BuildRequires: python3-sphinxcontrib-seqdiag
|
|
||||||
BuildRequires: python3-sphinxcontrib-svg2pdfconverter
|
|
||||||
|
|
||||||
%description doc
|
%description common
|
||||||
OpenStack bare metal provisioning service.
|
Components common to all OpenStack Ironic services
|
||||||
This package contains the Documentation.
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%package api
|
%package api
|
||||||
Summary: OpenStack Ironic - API
|
Summary: OpenStack Ironic - API
|
||||||
Group: System/Management
|
Requires: %{name}-common = %{version}-%{release}
|
||||||
Requires: openstack-ironic = %{epoch}:%{version}-%{release}
|
|
||||||
|
|
||||||
%description api
|
%description api
|
||||||
This package contains the OpenStack Ironic API Daemon.
|
This package contains the OpenStack Ironic API Daemon.
|
||||||
|
|
||||||
%package conductor
|
%package conductor
|
||||||
Summary: OpenStack Ironic - Conductor
|
Summary: OpenStack Ironic - Conductor
|
||||||
Group: System/Management
|
Requires: %{name}-common = %{version}-%{release}
|
||||||
Requires: openstack-ironic = %{epoch}:%{version}-%{release}
|
|
||||||
|
|
||||||
%description conductor
|
%description conductor
|
||||||
This package contains the OpenStack Ironic Conductor Manager Daemon.
|
This package contains the OpenStack Ironic Conductor Manager Daemon.
|
||||||
|
|
||||||
%prep
|
%package -n python3-ironic-tests
|
||||||
%autosetup -p1 -n ironic-16.0.4.dev3
|
Summary: Ironic unit tests
|
||||||
%py_req_cleanup
|
Requires: %{name}-common = %{version}-%{release}
|
||||||
|
Requires: python3-mock
|
||||||
|
Requires: python3-oslotest
|
||||||
|
Requires: python3-stestr
|
||||||
|
Requires: python3-testresources
|
||||||
|
Requires: python3-testscenarios
|
||||||
|
Requires: python3-testtools
|
||||||
|
|
||||||
|
|
||||||
|
%description -n python3-ironic-tests
|
||||||
|
This package contains the Ironic test files.
|
||||||
|
|
||||||
|
%prep
|
||||||
|
# Required for tarball sources verification
|
||||||
|
%setup -q -n ironic-%{upstream_version}
|
||||||
|
%patch0 -p1
|
||||||
|
# Let RPM handle the requirements
|
||||||
|
%py_req_cleanup
|
||||||
|
# Remove tempest plugin entrypoint as a workaround
|
||||||
|
sed -i '/tempest/d' setup.cfg
|
||||||
|
rm -rf ironic_tempest_plugin
|
||||||
%build
|
%build
|
||||||
%{py3_build}
|
%{py3_build}
|
||||||
|
|
||||||
%if 0%{?with_doc}
|
|
||||||
PYTHONPATH=. PBR_VERSION=16.0.4.dev3 sphinx-build --keep-going -b html doc/source doc/build/html
|
|
||||||
PYTHONPATH=. PBR_VERSION=16.0.4.dev3 sphinx-build --keep-going -b man doc/source doc/build/man
|
|
||||||
# remove the Sphinx-build leftovers
|
|
||||||
rm -rf doc/build/html/.{doctrees,buildinfo}
|
|
||||||
rm -rf doc/build/man/.{doctrees,buildinfo}
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%{py3_install}
|
%{py3_install}
|
||||||
|
|
||||||
### Setup directories
|
install -p -D -m 644 %{SOURCE5} %{buildroot}%{_sysconfdir}/logrotate.d/openstack-ironic
|
||||||
install -d -m 750 %{buildroot}%{_localstatedir}/{lib,log,cache}/ironic
|
|
||||||
install -d -m 755 %{buildroot}%{_sysconfdir}/ironic
|
|
||||||
install -d -m 755 %{buildroot}%{_sysconfdir}/ironic/ironic.conf.d/
|
|
||||||
install -d -m 700 %{buildroot}%{_localstatedir}/run/ironic
|
|
||||||
|
|
||||||
### Install configuration files
|
# install systemd scripts
|
||||||
install -D -m 644 %{SOURCE3} %{buildroot}/%_tmpfilesdir/ironic.conf
|
mkdir -p %{buildroot}%{_unitdir}
|
||||||
install -p -D -m 640 %{SOURCE4} %{buildroot}%{_sysconfdir}/ironic/ironic.conf.d/010-ironic.conf
|
install -p -D -m 644 %{SOURCE1} %{buildroot}%{_unitdir}
|
||||||
mv %{buildroot}%{_prefix}%{_sysconfdir}/ironic/* %{buildroot}%{_sysconfdir}/ironic/
|
install -p -D -m 644 %{SOURCE2} %{buildroot}%{_unitdir}
|
||||||
cp -a etc/ironic/rootwrap.d/ %{buildroot}%{_sysconfdir}/ironic/
|
|
||||||
install -p -D -m 640 %{SOURCE5} %{buildroot}%{_sysconfdir}/ironic/README.config
|
|
||||||
|
|
||||||
### Install systemd service files
|
# install sudoers file
|
||||||
install -p -D -m 644 %{SOURCE6} %{buildroot}%{_unitdir}/%{name}-api.service
|
mkdir -p %{buildroot}%{_sysconfdir}/sudoers.d
|
||||||
install -p -D -m 644 %{SOURCE7} %{buildroot}%{_unitdir}/%{name}-conductor.service
|
install -p -D -m 440 %{SOURCE3} %{buildroot}%{_sysconfdir}/sudoers.d/ironic
|
||||||
|
|
||||||
### install symlinks on SUSE
|
mkdir -p %{buildroot}%{_sharedstatedir}/ironic/
|
||||||
%if 0%{?suse_version}
|
mkdir -p %{buildroot}%{_localstatedir}/log/ironic/
|
||||||
mkdir -p %{buildroot}%{_sbindir}
|
mkdir -p %{buildroot}%{_sysconfdir}/ironic/rootwrap.d
|
||||||
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}-api
|
|
||||||
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}-conductor
|
|
||||||
%endif
|
|
||||||
|
|
||||||
### sudoers configuration for ironic-rootwrap:
|
#Populate the conf dir
|
||||||
install -D -m 440 %{SOURCE1} %{buildroot}%{_sysconfdir}/sudoers.d/openstack-ironic
|
export PYTHONPATH=.
|
||||||
|
oslo-config-generator --config-file tools/config/ironic-config-generator.conf --output-file %{buildroot}/%{_sysconfdir}/ironic/ironic.conf
|
||||||
|
oslopolicy-sample-generator --config-file tools/policy/ironic-policy-generator.conf
|
||||||
|
mv %{buildroot}%{_prefix}/etc/ironic/rootwrap.conf %{buildroot}/%{_sysconfdir}/ironic/rootwrap.conf
|
||||||
|
mv %{buildroot}%{_prefix}/etc/ironic/rootwrap.d/* %{buildroot}/%{_sysconfdir}/ironic/rootwrap.d/
|
||||||
|
# Remove duplicate config files under /usr/etc/ironic
|
||||||
|
rmdir %{buildroot}%{_prefix}/etc/ironic/rootwrap.d
|
||||||
|
rmdir %{buildroot}%{_prefix}/etc/ironic
|
||||||
|
|
||||||
### Install logrotate
|
# Install distribution config
|
||||||
install -p -D -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/logrotate.d/openstack-ironic
|
install -p -D -m 640 %{SOURCE4} %{buildroot}/%{_datadir}/ironic/ironic-dist.conf
|
||||||
|
|
||||||
### man pages
|
|
||||||
%if 0%{?with_doc}
|
|
||||||
mkdir -p %{buildroot}%{_mandir}/man1
|
|
||||||
install -p -D -m 644 doc/build/man/*.1 %{buildroot}%{_mandir}/man1/
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%check
|
%check
|
||||||
|
#PYTHON=%{__python3} stestr run
|
||||||
export LC_ALL=en_US.UTF-8
|
export LC_ALL=en_US.UTF-8
|
||||||
python3 -m stestr.cli run
|
python3 -m stestr.cli run
|
||||||
|
|
||||||
%pre
|
|
||||||
%openstack_pre_user_group_create ironic ironic /sbin/nologin
|
|
||||||
exit 0
|
|
||||||
|
|
||||||
%post
|
|
||||||
%tmpfiles_create %{_tmpfilesdir}/ironic.conf
|
|
||||||
|
|
||||||
%post api
|
|
||||||
%systemd_post %{name}-api.service
|
|
||||||
|
|
||||||
%preun api
|
|
||||||
%systemd_preun %{name}-api.service
|
|
||||||
|
|
||||||
%postun api
|
|
||||||
%systemd_postun %{name}-api.service
|
|
||||||
|
|
||||||
%post conductor
|
|
||||||
%systemd_post %{name}-conductor.service
|
|
||||||
|
|
||||||
%preun conductor
|
|
||||||
%systemd_preun %{name}-conductor.service
|
|
||||||
|
|
||||||
%postun conductor
|
|
||||||
%systemd_postun %{name}-conductor.service
|
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%doc README.rst
|
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%dir %attr(0750, ironic, ironic) %{_localstatedir}/lib/ironic
|
|
||||||
%dir %attr(0750, ironic, ironic) %{_localstatedir}/cache/ironic
|
|
||||||
%dir %attr(0750, ironic, ironic) %{_localstatedir}/log/ironic
|
|
||||||
%_tmpfilesdir/ironic.conf
|
|
||||||
%dir %{_sysconfdir}/ironic
|
|
||||||
%dir %{_sysconfdir}/ironic/ironic.conf.d/
|
|
||||||
%{_sysconfdir}/ironic/README.config
|
|
||||||
%config(noreplace) %{_sysconfdir}/logrotate.d/openstack-ironic
|
|
||||||
%config(noreplace) %{_sysconfdir}/sudoers.d/openstack-ironic
|
|
||||||
%config(noreplace) %attr(0640, root, ironic) %{_sysconfdir}/ironic/ironic.conf.d/010-ironic.conf
|
|
||||||
%config %{_sysconfdir}/ironic/rootwrap.conf
|
|
||||||
%dir %{_sysconfdir}/ironic/rootwrap.d
|
|
||||||
%config(noreplace) %{_sysconfdir}/ironic/rootwrap.d/ironic-utils.filters
|
|
||||||
%{_bindir}/ironic-status
|
|
||||||
%{_bindir}/ironic-rootwrap
|
|
||||||
%{_bindir}/ironic-dbsync
|
|
||||||
%if 0%{?with_doc}
|
|
||||||
%{_mandir}/man1/ironic.1.gz
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%files -n python3-ironic
|
%files -n python3-ironic
|
||||||
|
%doc README.rst
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%{python3_sitelib}/ironic/
|
%{python3_sitelib}/ironic
|
||||||
%{python3_sitelib}/ironic-*.egg-info
|
%{python3_sitelib}/ironic-*.egg-info
|
||||||
|
%exclude %{python3_sitelib}/ironic/tests
|
||||||
|
|
||||||
%if 0%{?with_doc}
|
%files common
|
||||||
%files doc
|
%doc README.rst
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%doc doc/build/html
|
%{_bindir}/ironic-dbsync
|
||||||
%endif
|
%{_bindir}/ironic-rootwrap
|
||||||
|
%{_bindir}/ironic-status
|
||||||
|
%{_sysconfdir}/sudoers.d/ironic
|
||||||
|
%config(noreplace) %{_sysconfdir}/logrotate.d/openstack-ironic
|
||||||
|
%config(noreplace) %attr(-,root,ironic) %{_sysconfdir}/ironic
|
||||||
|
%attr(-,ironic,ironic) %{_sharedstatedir}/ironic
|
||||||
|
%attr(0750,ironic,ironic) %{_localstatedir}/log/ironic
|
||||||
|
%attr(-, root, ironic) %{_datadir}/ironic/ironic-dist.conf
|
||||||
|
|
||||||
|
%pre common
|
||||||
|
getent group ironic >/dev/null || groupadd -r ironic
|
||||||
|
getent passwd ironic >/dev/null || \
|
||||||
|
useradd -r -g ironic -d %{_sharedstatedir}/ironic -s /sbin/nologin \
|
||||||
|
-c "OpenStack Ironic Daemons" ironic
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
|
||||||
%files api
|
%files api
|
||||||
%license LICENSE
|
|
||||||
%{_unitdir}/%{name}-api.service
|
|
||||||
%if 0%{?suse_version}
|
|
||||||
%{_sbindir}/rc%{name}-api
|
|
||||||
%endif
|
|
||||||
%{_bindir}/ironic-api
|
%{_bindir}/ironic-api
|
||||||
%{_bindir}/ironic-api-wsgi
|
%{_bindir}/ironic-api-wsgi
|
||||||
|
%{_unitdir}/openstack-ironic-api.service
|
||||||
|
|
||||||
|
%post api
|
||||||
|
%systemd_post openstack-ironic-api.service
|
||||||
|
|
||||||
|
%preun api
|
||||||
|
%systemd_preun openstack-ironic-api.service
|
||||||
|
|
||||||
|
%postun api
|
||||||
|
%systemd_postun_with_restart openstack-ironic-api.service
|
||||||
|
|
||||||
%files conductor
|
%files conductor
|
||||||
%license LICENSE
|
|
||||||
%{_unitdir}/%{name}-conductor.service
|
|
||||||
%if 0%{?suse_version}
|
|
||||||
%{_sbindir}/rc%{name}-conductor
|
|
||||||
%endif
|
|
||||||
%{_bindir}/ironic-conductor
|
%{_bindir}/ironic-conductor
|
||||||
|
%{_unitdir}/openstack-ironic-conductor.service
|
||||||
|
|
||||||
|
%post conductor
|
||||||
|
%systemd_post openstack-ironic-conductor.service
|
||||||
|
|
||||||
|
%preun conductor
|
||||||
|
%systemd_preun openstack-ironic-conductor.service
|
||||||
|
|
||||||
|
%postun conductor
|
||||||
|
%systemd_postun_with_restart openstack-ironic-conductor.service
|
||||||
|
|
||||||
|
%files -n python3-ironic-tests
|
||||||
|
%{python3_sitelib}/ironic/tests
|
||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Tue Feb 09 2021 huangtianhua <huangtianhua223@gmail.com>
|
* Mon Nov 29 2021 lijiawei <ljw1101.vip@gmail.com> - 13.0.7-4
|
||||||
- Enable with_doc to generate docs
|
- Adds python3-sendfile as requires
|
||||||
* Mon Feb 08 2021 OpenStack rpm-packaging <huangtianhua223@gmail.com>
|
|
||||||
- Package Spec generated
|
* Thu Nov 18 2021 huangtianhua <huangtianhua@huawei.com> - 13.0.7-3
|
||||||
|
- Adds python3-wsme as buildrequires and fix build error
|
||||||
|
|
||||||
|
* Mon Nov 15 2021 huangtianhua <huangtianhua@huawei.com> - 13.0.7-2
|
||||||
|
- Adds python3-pysendfile as buildrequires
|
||||||
|
|
||||||
|
* Fri Nov 05 2021 lijiawei <ljw1101.vip@gmail.com> - 13.0.7-1
|
||||||
|
- Support OpenStack Train release
|
||||||
|
|||||||
@ -1 +0,0 @@
|
|||||||
d /run/ironic 0700 ironic ironic -
|
|
||||||
Loading…
x
Reference in New Issue
Block a user