Commit Graph

32 Commits

Author SHA1 Message Date
Javier Pena fe9620acd4 Fix pip setup for RHEL 8
On RHEL 8, we have no pip but we have pip3, so we need to adapt the
pip detection and setup to this.

This also requires taking into account a new possible location for
packstack.rst, under /usr/local/share.

Change-Id: I3b93449fb4b7faabb15a8b186d2be1c174b754b6
2019-02-19 17:33:59 +01:00
Javier Pena 1948987952 Remove runtime dependency on setuptools
We were only depending on setuptools for runtime to use pkg_resources,
so we could fetch the path to the rst documentation in certain cases
(mainly during development). We can figure out that path using
other means, so we do not depend on setuptools anymore.

Closes-Bug: #1713950
Change-Id: I9c0f676ac2219001118f7191a6e5c8faee3312c4
2017-09-04 11:22:10 +02:00
Alan Pevec 1bbcbff4fb Use PBR
Refactor setup.py using Python Build Reasonableness[1]
as a standard for OpenStack projects.

[1] http://docs.openstack.org/developer/pbr/

Closes-Bug: #1559150
Change-Id: Ie3b3845f11236f5338228690418760599914cce4
2016-09-21 17:49:02 +02:00
Javier Pena 499e2188aa Remove OPM dependency resolution in prescript
Previously, the dependencies for the openstack-puppet-modules and
openstack-packstack-puppet RPMs were being manually resolved and
installed in any non-installer node (usually the controller). Since
Newton, the OPM package is a meta-package, that includes all the
puppet-* packages as dependencies. In this context, Packstack would
try to install all puppet-* packages in all nodes, which is not
needed and causes issues.

We are solving this by removing the dependency resolution code, adding
a new array to include OPM dependencies (only rubygem-json as of now)
and installing them when needed. Note that, if a dependency is added
to any puppet package, it will have to be added to Packstack as well.
CI will notify us, though.

Change-Id: I54d0c0296c0b57946e7af1f7fd13dae35c1c1a36
2016-05-03 16:42:11 +02:00
David Moreau Simard 4c55410145 Use relative path instead of absolute path for latest symlink
This maintains the intended functionality while simultaneously
allowing to copy or move the folder somewhere else.
Otherwise, if I copy /var/tmp/packstack elsewhere, the symlink
will keep pointing to /var/tmp/packstack.

Change-Id: I7da0af24dbccb14d1f7fb1d75079ac109e981882
2016-01-28 11:07:18 -05:00
Lukas Bezdicka 1af9006c04 [Packstack] Add symbolic link for latest log dir
Apply patch from  David Xie (davidx@fedoraproject.org) to add
/var/tmp/packstack/latest symbolic link pointing to latest packstack
log dir.

Closes-Bug: rhbz#1051828
Change-Id: I1d931a073234b6ebd01d1505e4606f377b537b45
2015-06-03 13:53:57 +02:00
Martin Mágr d14f898ed2 Allow CIDR instead of iterface name
This patch implements translation from CIDR to interface name,
which should allow deployments to heretogenous infrastructure.

Package openstack-packstack-puppet will need new require,
which is rubygem-ippaddress.

Workaround for rhbz#1200604

Change-Id: Id27881f616781e5a24a1bdb1e169915b7619eebd
2015-05-18 15:17:52 +02:00
Martin Mágr 2548b37a1b Improve discovery logic
This patch improves hosts' discovery logic by using Facter to do the work.
Original code was taken from Kanzo (https://github.com/paramite/kanzo)

Prerequisite for fixing rhbz#1200604

Change-Id: I8de024e55679d70a5d16f48df51337ebfea37514
2015-04-07 09:52:02 +00:00
Martin Mágr 9a347f80d5 Single source of documentation
This patch adds feature for parsing docs/packstack.rst file for parameter
USAGE values.

Change-Id: Iea404e8ade657e82ac1e33ad3697180680c3633e
Closes-bug: rhbz#1199847
2015-03-30 12:37:51 +02:00
Christian Berendt d7916cec60 Enable PEP8 checks H102, H232, H233, H301, H904
* H102  Apache 2.0 license header not found
* H232  Python 3.x incompatible octal xxx should be written as 0oxxx
* H233  Python 3.x incompatible use of print operator
* H301  one import per line
* H904  Wrap long lines in parentheses instead of a backslash

Change-Id: I07003acb76eaa719daabc451239067494efa2bba
2015-02-02 10:45:44 +01:00
Christian Berendt c532db1461 Enable several PEP8 checks
* E122 continuation line missing indentation or outdented
* E126 continuation line over-indented for hanging indent
* E127 continuation line over-indented for visual indent
* E128 continuation line under-indented for visual indent
* E131 continuation line unaligned for hanging indent
* E303 too many blank lines
* W601 .has_key() is deprecated, use 'in'
* H234 assertEquals is deprecated, use assertEqual
* H401 docstring should not start with a space
* H402 one line docstring needs punctuation.

Change-Id: I1c264dba19bfe7cb9173e8999429827bd026b930
2015-01-21 19:11:49 +01:00
Christian Berendt 713b745e0e Enable PEP8 checks for F401, E202, E271, E272, E711, E712
* F401 module imported but unused
* E271 multiple spaces after keyword
* E272 multiple spaces before keyword
* E202 remove extraneous whitespace
* E711 comparison to None should be 'if cond is None:'
* E712 comparison to True/False should be 'if cond is True/False:' or 'if cond:'

Change-Id: I56a1dbee2ae17b8315a55215e2c676e0de8311f7
2015-01-16 13:11:31 +01:00
Jenkins 657a48e59c Merge "Print the used logfile also at the beginning" 2014-12-16 12:38:50 +00:00
Christian Berendt 8acb7cc11d Print the used logfile also at the beginning
Change-Id: Icb3a44c36b50b31b3436c3e693f6d88879b70080
2014-12-09 21:37:39 +01:00
Christian Berendt 85ceabbfaf Change the APP_NAME to Packstack
Instead of 'Welcome to Installer setup utility' it should be
'Welcome to the Packstack setup utility'.

Change-Id: I698d17645f4a53ce738be5ea463335466408ed6e
2014-12-09 20:05:40 +01:00
Gael Chamoulaud 219cf98b4f Adds Hiera implementation within Packstack
Packstack configures Hiera as data backend. Packstack puppet templates are now
using hiera() and hiera_array() functions to fetch data from hiera backend.

Packstack generates a defaults.yaml file in the /var/tmp/packstack directory.

Firewall rules for each openstack components are inserted into the hiera
backend as hash and created by the create_resources function.

Change-Id: Iab553a71264b0fc0f26d33a6304b545ad302f664
Fixes: rhbz#1145223
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
2014-10-27 14:49:09 +01:00
Christian Berendt 8e65d181d2 Use except x as y instead of except x, y
According to https://docs.python.org/3/howto/pyporting.html the
syntax changed in Python 3.x. The new syntax is usable with
Python >= 2.6 and should be preferred to be compatible with Python3.

Change-Id: I4a951aecc32ef9e5131da236ae4815b84897d67b
2014-06-03 07:53:51 +02:00
Martin Magr ce423165ca Revert "Move packstack logs to /var/log/packstack"
Due to security reasons.
This reverts commit 075eb3f5a8.

Change-Id: Ie12d3a57d9d25cb5d89c88e7761b1b8db7793b06
2013-12-11 13:28:57 +01:00
Ivan Chavero 075eb3f5a8 Move packstack logs to /var/log/packstack
Move packstack and puppet logs to a more proper
location.

Change-Id: I83ce52865302738706425b0ca661ec46a9a445bc
Fixes: rhbz#999923
2013-12-03 16:24:50 +01:00
Martin Magr bd41088be6 Creates keystonerc_admin for user
- creates keystonerc_admin for user running Packstack
in case OpenStack client host is the host where packstack
is running (eg. all-in-one installation)

Change-Id: I37be40de46f54c78c934a27bc3f5e3c9381e7f19
Fixes: rhbz#964005, rhbz#976394
2013-10-07 12:33:22 +02:00
Jenkins 13be9dad7d Merge "Change ownership of /var/tmp/packstack if it is possible" 2013-05-22 12:42:52 +00:00
Martin Magr a59e0803ce Change ownership of /var/tmp/packstack if it is possible
Change-Id: Id0fd6ab11f7ddab527dc2791b8d8733f974b3377
Fixes: rhbz#920516
2013-05-22 10:27:37 +02:00
Martin Magr 4e4149db97 Refactored packstack.installer.setup_sequences
Change-Id: Ie4b039ed9c4996240c20a033d91b936c8113214b
2013-05-14 13:58:33 +02:00
Martin Magr eba1d3d5d2 Cleaned packstack.installer.common_utils
- cleaned from useless functions
- refactored to be pep8 compliant
- separated to standalone modules
- added unit tests

Change-Id: If5a300fe04efab9e13549f2b4d05c1b28e2e40c6
2013-04-17 13:29:20 +02:00
Derek Higgins 43a6642b3d Add unit test to test running from command line
This test effectivly runs all of the python code ran by
packstack --install-hosts=127.0.0.1 --os-swift-install=y \
--nagios-install=y

It is a fairly wide net but boost code coverage of the packstack
python code to about 85%, more finer grained tests should also be
Added to target speficic test cases.

Popen is replaced in PackstackTestCaseMixin so no actual commands get
run on the host running the unit tests

Change-Id: Ie5208394d6eb6034a3044014ffc35482805e41fd
2013-04-15 15:28:11 +00:00
Martin Magr 0e7a1aec8e Fixed temp dir conflict
Fixed invalid validator

Change-Id: I72d6e00d895a0fb360d3d05da9b44e0e63322869
2013-02-13 12:51:05 +01:00
Derek Higgins 624d49a0e8 Securely create temp directorys / files
The temp directory packstack was using was being created in
an insecure manor with world readable permissions. This commit ensures
temp directories are created securly on both the local and remote
hosts

o Create var directory with tempfile.mkdtemp
o remove other places where var directory was created
o change permissions of all files that do (or may) contain
  sensitive data to 600
o No longer append data to mainifest file, it is now created and
  writen out in once
o Attempts to remove data on remote hosts after the packstach run

CVE-2013-0261
https://bugzilla.redhat.com/show_bug.cgi?id=908101

Change-Id: Ie7105207d3da128d630628c1df037ffafc94beb8
2013-02-12 09:16:06 -05:00
Flaper Fesp 72cc85278c Use /var/tmp/packstack/{%Y%m%d-%H%M} as working dir name
Collect all packstack's logs in a subdirectory called packstack and use
a '%Y%m%d-%H%M' formated datetime instead of a uuid for folder names.

Fixes bz#888360

Change-Id: Ib5a3bcc74e7819c3c3ee43d2b790922fad358e40
2013-01-25 14:31:03 +01:00
Martin Magr bb2edfef7d Added missing basedef 2012-12-13 16:36:30 +01:00
Derek Higgins bdd0e30f14 Define PUPPET_MANIFEST_DIR in basedefs
Also moving it to /var/tmp/uuid
2012-11-28 12:10:28 +00:00
Derek Higgins cddf92884e Moving log dir to /var/tmp 2012-11-28 12:09:39 +00:00
Derek Higgins 29a82333a6 Restructuring project for python's setuptools 2012-11-27 09:39:15 +00:00