Add base setup fuel-bootstrap utility

* Implement setup.py for module contrib/mk_bootstrap/fuel_bootstrap
* Extend fuel-agent.spec

Change-Id: I40d717a91eb4f4b1f6972d50a590deb135e38b5a
Implements: blueprint bootstrap-images-support-in-cli
This commit is contained in:
alexz 2015-11-20 12:22:25 +02:00 committed by Aleksey Zvyagintsev
parent c33563d561
commit 1ecc38438a
10 changed files with 92 additions and 0 deletions

View File

View File

@ -0,0 +1 @@
Artur Svechnikov <asvechnikov@mirantis.com>

View File

@ -0,0 +1,5 @@
include AUTHORS
include ChangeLog
exclude .gitignore
global-exclude *.pyc

View File

@ -0,0 +1,6 @@
PyYAML>=3.1.0
argparse
stevedore
pbr>=0.6
cliff>=1.7.0
six>=1.7.0

View File

@ -0,0 +1,34 @@
[metadata]
name = fuel-bootstrap
version = 0.0.2
summary = Command line Fuel bootstrap manager
author = Mirantis Inc.
author-email = product@mirantis.com
home-page = http://mirantis.com
description-file =
README.rst
classifier =
Environment :: OpenStack
Intended Audience :: Information Technology
Intended Audience :: System Administrators
License :: OSI Approved :: Apache Software License
Operating System :: POSIX :: Linux
Programming Language :: Python
Programming Language :: Python :: 2
Programming Language :: Python :: 2.6
Programming Language :: Python :: 2.7
[files]
packages =
fuel_bootstrap
[entry_points]
console_scripts =
fuel-bootstrap=fuel_bootstrap.main:main
fuel_bootstrap =
build=fuel_bootstrap.commands.build:BuildCommand
list=fuel_bootstrap.commands.list:ListCommand
import=fuel_bootstrap.commands.import:ImportCommand
activate=fuel_bootstrap.commands.activate:ActivateCommand
delete=fuel_bootstrap.commands.delete:DeleteCommand

View File

@ -0,0 +1,29 @@
# -*- coding: utf-8 -*-
# Copyright 2015 Mirantis, Inc.
#
# 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.
import setuptools
# In python < 2.7.4, a lazy loading of package `pbr` will break
# setuptools if some other modules registered functions in `atexit`.
# solution from: http://bugs.python.org/issue15881#msg170215
try:
import multiprocessing # noqa
except ImportError:
pass
setuptools.setup(
setup_requires=['pbr'],
pbr=True)

View File

@ -63,6 +63,12 @@ Group: Development/Libraries
%description -n ironic-fa-bootstrap-configs
Ironic bootstrap config files with Fuel Agent
%package -n fuel-bootstrap-cli
Summary: Fuel-bootstrap wrapper tool
Group: Development/Libraries
%description -n fuel-bootstrap-cli
User-friendly wrapper for user set of scripts from fuel-agent
%prep
%setup -cq -n %{name}-%{version}
@ -70,6 +76,8 @@ Ironic bootstrap config files with Fuel Agent
%build
cd %{_builddir}/%{name}-%{version} && python setup.py build
#building fuel-bootstrap-cli
cd %{_builddir}/%{name}-%{version}/contrib/mk_bootstrap/fuel_bootstrap/ && PBR_VERSION=%{version} python setup.py build
%install
cd %{_builddir}/%{name}-%{version} && python setup.py install --single-version-externally-managed -O1 --root=$RPM_BUILD_ROOT --record=%{_builddir}/%{name}-%{version}/INSTALLED_FILES
@ -83,6 +91,11 @@ install -p -D -m 644 %{_builddir}/%{name}-%{version}/cloud-init-templates/* %{bu
install -d -m 755 %{buildroot}%{_datadir}/ironic-fa-bootstrap-configs/
cp -a %{_builddir}/%{name}-%{version}/contrib/ironic/bootstrap-files/* %{buildroot}%{_datadir}/ironic-fa-bootstrap-configs/
#Install fuel-bootstrap-cli files
cd %{_builddir}/%{name}-%{version}/contrib/mk_bootstrap/fuel_bootstrap/ && PBR_VERSION=%{version} python setup.py install --single-version-externally-managed -O1 --root=$RPM_BUILD_ROOT --record=%{_builddir}/%{name}-%{version}/contrib/mk_bootstrap/fuel_bootstrap/INSTALLED_FILES
install -d -m 755 %{buildroot}%{_datadir}/mk_bootstrap/files/
cp -a %{_builddir}/%{name}-%{version}/contrib/mk_bootstrap/files/* %{buildroot}%{_datadir}/mk_bootstrap/files/
%clean
rm -rf $RPM_BUILD_ROOT
@ -95,3 +108,7 @@ rm -rf $RPM_BUILD_ROOT
%files -n ironic-fa-bootstrap-configs
%attr(0644,root,root) %config(noreplace) %{_datadir}/ironic-fa-bootstrap-configs/*
%attr(0755,root,root) %config(noreplace) %{_datadir}/ironic-fa-bootstrap-configs/usr/bin/configure-remote-logging.sh
%files -n fuel-bootstrap-cli -f %{_builddir}/%{name}-%{version}/contrib/mk_bootstrap/fuel_bootstrap/INSTALLED_FILES
%defattr(-,root,root)
%attr(0644,root,root) %config(noreplace) %{_datadir}/mk_bootstrap/files/*