Commit Graph

27 Commits

Author SHA1 Message Date
erbarr 0e2f2a987b Return 404 if not enough ready in pool
This changes the behavior to prevent locking a node that does not match
the requested pool. Currently using a pool locks a node in that pool if
there is one ready, as expected. If there is not one ready from the
pool but there is any other node ready, it will lock a node outside the
pool, not expected and breaking behavior. Also update to handle PyYAML 6.0.0

Change-Id: I285256037e16f94c79cc7d813235460b4032393d
2021-10-25 17:08:14 -05:00
Riccardo Pittau 5cf167d567 Update molteniron tests and requirements
Make things as pretty as possible while moving to current openstack
Y cycle tests.

Change-Id: I22777cf34888171daf69c44705d8ecc7339f8278
2021-10-06 18:12:20 +02:00
Hervé Beraud 524d1f1c7d Stop to use the __future__ module.
The __future__ module [1] was used in this context to ensure compatibility
between python 2 and python 3.

We previously dropped the support of python 2.7 [2] and now we only support
python 3 so we don't need to continue to use this module and the imports
listed below.

Imports commonly used and their related PEPs:
- `division` is related to PEP 238 [3]
- `print_function` is related to PEP 3105 [4]
- `unicode_literals` is related to PEP 3112 [5]
- `with_statement` is related to PEP 343 [6]
- `absolute_import` is related to PEP 328 [7]

[1] https://docs.python.org/3/library/__future__.html
[2] https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html
[3] https://www.python.org/dev/peps/pep-0238
[4] https://www.python.org/dev/peps/pep-3105
[5] https://www.python.org/dev/peps/pep-3112
[6] https://www.python.org/dev/peps/pep-0343
[7] https://www.python.org/dev/peps/pep-0328

Change-Id: Iaf6e2c9b16d053a8c279a48a25979c941b1c00da
2020-06-02 20:23:59 +02:00
kesper 6eb00df34c Adding node_pool as a optional argument
This commit add node_pool options which allow user to create
different pools of hardware depends of their type.

Change-Id: If35158e35c405afcc1158e7f4015dea6048ce59f
2017-05-12 04:32:27 +00:00
Jenkins daed944018 Merge "Return complete reservation id" 2017-02-28 14:01:33 +00:00
Mark Hamzy f9f122da4a Return complete reservation id
Changed the length of the provisioned field for the
molteniron status command.  Also added the missing
ipmi_ip field for the blob_status aggregate.

Change-Id: I97c4a82a2467297223b929a29b73e6a8d41f019d
Closes-Bug: 1650332
2017-02-24 20:19:51 -06:00
Mark Hamzy b3b6dda18d Support both Ubuntu and CentOS
CentOS installs molteniron into /usr/etc/molteniron instead of
/usr/local/etc/molteniron/ so we have moved the conf.yaml file
into the molteniron Python directory and started using
pkg_resources.resource_filename to find our data file.

Change-Id: I75330d51475051a04bb2dff903f54727b9be9b6e
2017-02-21 15:12:30 -06:00
Jenkins ee86a2519e Merge "Start testing the example usage for CI: test_hook_mi_ipmiblob.py" 2017-01-04 17:29:19 +00:00
Mark Hamzy 57160823d4 Start testing the example usage for CI: test_hook_mi_ipmiblob.py
test_hook_mi_ipmiblob.py is the provided sample for a CI team to
use to allocate a MoltenIron instance before running tests.

Change-Id: I217b8e3ba14cb3c4358d71be40ad9ca80aca32e1
2016-12-16 10:48:22 -06:00
Mark Hamzy 6ac505d94c Separate out the class MoltenIron
Putting MoltenIron as a public class in the library allows
clients to programatically call the server and perform
operations.

Change-Id: I9fb03ee5de56c9196d6aaf983dfe22135f29c568
2016-11-30 13:09:14 -06:00
Mark Hamzy ffb2c3380f Add some more debugging to Database:__init__
Preserve some history as to why this code is like what it is.

Change-Id: I49e023348996a1ebdf46aeda030511e92efc6223
2016-11-09 16:26:34 -06:00
Mark Hamzy 5f009133dd Fix Python3's sending bytes versus strings
Change-Id: Ie2557766ad110c1a3fb4721e902a41aa88cd7272
2016-11-08 13:21:55 -06:00
Tony Breeds caa3cb7710 [WiP] Switch to PyMySQL
I couldn't get the tests to run locally so wasting gate resources

Change-Id: I983a2d3788fade3fef67feaa94c29b02dfbdf8c0
2016-11-08 12:53:35 -06:00
Mark Hamzy 952d4b133f Switch to using a blob of JSON encoded data
- ipmi_user VARCHAR(50),
- ipmi_password VARCHAR(50),
- port_hwaddr VARCHAR(50),
- cpu_arch VARCHAR(50),
- cpus INTEGER,
- ram_mb INTEGER,
- disk_gb INTEGER,
+ blob VARCHAR(2000),

Change-Id: I7a329d8137f877f111213af4332f50b1d8ff7295
2016-11-03 12:08:12 -05:00
Mark Hamzy 24bf07c892 Fix --output=json so that it prints out JSON
The program was actually printing out a Python map variable
instead.

Change-Id: I6802bdac30a915f9643164fe6bbb5136844900e7
2016-11-01 14:00:34 -05:00
Mark Hamzy dfe2cf5496 Add help text to the subcommands
Change-Id: I87957673436c2249fa7523aa89796d32aa5eb3ce
2016-10-30 14:28:30 -05:00
Mark Hamzy 9952754ce4 Add result parameter which will only printout the result contents
Change-Id: Ia033695472de42a1808bbecd2183ef790e6548f6
2016-10-30 13:44:05 -05:00
Mark Hamzy f6be130863 Add type parameter for the status command
Where type can be human (the default) or csv

Change-Id: I35f8944bced8ba85972a66a31ac98d04bd3aa984
2016-10-30 13:18:38 -05:00
Mark Hamzy 7efb4ae83a Even more pep8 fixes that the gate is catching
Change-Id: I825621d82bdc4e30a024b639f34e8be0d8593c17
2016-10-27 12:08:57 -05:00
Mark Hamzy 0b641d436e Support both Python 2.x and Python 3.x
Change-Id: If2b02553859345a4322e0a2fd56ce1f7436c08ca
2016-10-27 10:45:29 -05:00
Mark Hamzy d9afc4be46 Add files that were created running Python's cookiecutter program
Change-Id: Iac06fc379d11972601c362619b0d02e7839449d5
2016-10-27 10:18:47 -05:00
Mark Hamzy ae3df717de Fix PEP8 issues
Change-Id: I6cfebccba269c21e752307966093cfb216b81c2c
2016-10-25 09:28:39 -05:00
Mark Hamzy cf0635f306 Fix command line help
Setting up Python's argument parser was broken here.  Everything
needed rewriting...

Change-Id: I210cc1217bfa6ffd74c89974d0587934a9e1a726
2016-10-24 19:57:23 -05:00
Mark Hamzy af2b0c097f Create _setup_response()
This function will move http and json processing into a new
function done on demand after class initialization.

Change-Id: Ibf57f1e23912f7878287c6f85efd9ea93c7f13a1
2016-10-24 19:45:11 -05:00
Mark Hamzy 707f272eb8 Add more debugging when moltenirond-helper fails
Added custom Exception classes and raised them in get_moltenirond_pid.

Added log_error to log to stderr and a logfile
called /tmp/MoltenIron-error-logfile.

Change-Id: I2855cf832c2a1a8f5ef9df34cf96706eb5406276
2016-10-24 14:07:19 -05:00
Mark Hamzy 7ccb031845 Fix log directory handling 2016-10-19 14:33:06 -05:00
Mark Hamzy dcd5fc4279 Add support for installation and testing
Moved files to a new directory to support the installation
of the molteniron package.  Renamed one file to be a
command line tool and added a new file to start/stop
the daemon.

Added tox support for testing.  This needed the ability
to start and stop the daemon.  And it also needed the
ability to delete the database entries to ensure a clean
test run.

Change-Id: I1b0fadd68b9598b715c639b962cf8586f4db5da8
2016-09-15 13:05:00 -05:00