[Python-modules-commits] [python-hpilo] 01/09: Import python-hpilo_3.6.orig.tar.gz

Sandro Tosi morph at moszumanska.debian.org
Mon Feb 8 21:54:25 UTC 2016


This is an automated email from the git hooks/post-receive script.

morph pushed a commit to branch master
in repository python-hpilo.

commit 7206e193c9cadcdadb5d3a7839a43db1be8683a8
Author: Sandro Tosi <morph at debian.org>
Date:   Mon Feb 8 21:27:58 2016 +0000

    Import python-hpilo_3.6.orig.tar.gz
---
 CHANGES                                            |   49 +
 COPYING                                            |   19 +-
 PKG-INFO                                           |    5 +-
 README                                             |   39 -
 README.md                                          |   64 +
 docs/_static/kibana.png                            |  Bin 0 -> 38907 bytes
 docs/_static/lightbulb.png                         |  Bin 3836 -> 0 bytes
 docs/_static/python-hpilo.png                      |  Bin 0 -> 11771 bytes
 docs/ahs.rst                                       |   25 +
 docs/authentication.rst                            |   35 +
 docs/autofirmware.rst                              |   51 +
 docs/boot.rst                                      |   30 +
 docs/ca.rst                                        |   56 +-
 docs/conf.py                                       |   11 +-
 docs/contributing.rst                              |   23 +-
 docs/elasticsearch.rst                             |   50 +
 docs/federation.rst                                |   23 +
 docs/firmware.rst                                  |    4 +-
 docs/health.rst                                    |   15 +
 docs/ilo.rst                                       |   23 -
 docs/ilodoc.py                                     |   37 +
 docs/index.rst                                     |  139 +-
 docs/info.rst                                      |   49 +
 docs/input.rst                                     |   15 +
 docs/install.rst                                   |   71 +-
 docs/license.rst                                   |   15 +
 docs/log.rst                                       |   17 +
 docs/media.rst                                     |   19 +
 docs/networksettings.rst                           |   14 +
 docs/output.rst                                    |  543 -----
 docs/output/get_ahs_status                         |    3 +
 docs/output/get_all_languages                      |    1 +
 docs/output/get_all_licenses                       |    4 +
 docs/output/get_all_user_info                      |    7 +
 docs/output/get_all_users                          |    1 +
 docs/output/get_asset_tag                          |    3 +
 docs/output/get_asset_tag_1                        |    1 +
 docs/output/get_cert_subject_info                  |    9 +
 docs/output/get_current_boot_mode                  |    1 +
 docs/output/get_dir_config                         |   31 +
 docs/output/get_embedded_health                    |  475 ++++
 docs/output/get_encrypt_settings                   |    8 +
 docs/output/get_ers_settings                       |   12 +
 docs/output/get_federation_all_groups              |    1 +
 docs/output/get_federation_all_groups_info         |    7 +
 docs/output/get_federation_group                   |    9 +
 docs/output/get_federation_multicast               |    4 +
 docs/output/get_fips_status                        |    1 +
 docs/output/get_fw_version                         |    4 +
 docs/output/get_global_settings                    |   30 +
 docs/output/get_host_data                          |  104 +
 docs/output/get_host_power_saver_status            |    1 +
 docs/output/get_host_power_status                  |    1 +
 docs/output/get_host_pwr_micro_ver                 |    1 +
 docs/output/get_hotkey_config                      |    6 +
 docs/output/get_ilo_event_log                      |   19 +
 docs/output/get_language                           |    1 +
 docs/output/get_network_settings                   |   64 +
 docs/output/get_oa_info                            |    7 +
 docs/output/get_one_time_boot                      |    1 +
 docs/output/get_pending_boot_mode                  |    1 +
 docs/output/get_pers_mouse_keyboard_enabled        |    1 +
 docs/output/get_persistent_boot                    |    1 +
 docs/output/get_power_cap                          |    1 +
 docs/output/get_power_readings                     |    4 +
 docs/output/get_product_name                       |    1 +
 docs/output/get_pwreg                              |    4 +
 docs/output/get_rack_settings                      |    6 +
 docs/output/get_security_msg                       |    2 +
 docs/output/get_server_auto_pwr                    |    1 +
 docs/output/get_server_event_log                   |   40 +
 docs/output/get_server_fqdn                        |    1 +
 docs/output/get_server_name                        |    1 +
 docs/output/get_server_power_on_time               |    2 +
 docs/output/get_smh_fqdn                           |    1 +
 docs/output/get_snmp_im_settings                   |   26 +
 docs/output/get_spatial                            |   16 +
 docs/output/get_sso_settings                       |   19 +
 docs/output/get_supported_boot_mode                |    1 +
 docs/output/get_tpm_status                         |    2 +
 docs/output/get_twofactor_settings                 |    3 +
 docs/output/get_uid_status                         |    1 +
 docs/output/get_user                               |    9 +
 docs/output/get_vm_status                          |    6 +
 docs/output/xmldata                                |   59 +
 docs/output/xmldata_1                              | 2553 ++++++++++++++++++++
 docs/power.rst                                     |   36 +
 docs/profile.rst                                   |   16 +
 docs/puppet.rst                                    |  287 +++
 docs/python.rst                                    |   89 +
 docs/security.rst                                  |   27 +
 docs/{cli.rst => shell.rst}                        |   77 +-
 docs/snmp.rst                                      |   15 +
 docs/xmldata.rst                                   |   15 +
 hpilo_ca => examples/ca/hpilo_ca                   |  184 +-
 examples/elasticsearch/hpilo_es_dump               |   42 +
 examples/elasticsearch/hpilo_es_import             |  149 ++
 examples/elasticsearch/kibana-dashboard.json       |   69 +
 examples/elasticsearch/servers.py.example          |   18 +
 examples/firmwareupdater/hpilo_firmware_update     |  108 +
 .../puppet/modules/ilo/lib/puppet/provider/ilo.rb  |   20 +
 .../puppet/provider/ilo_firmware/ilo_firmware.rb   |   42 +
 .../lib/puppet/provider/ilo_license/ilo_license.rb |   24 +
 .../puppet/provider/ilo_settings/ilo_settings.rb   |   38 +
 .../ilo/lib/puppet/provider/ilo_user/ilo_user.rb   |   55 +
 .../modules/ilo/lib/puppet/type/ilo_firmware.rb    |   63 +
 .../modules/ilo/lib/puppet/type/ilo_license.rb     |   14 +
 .../modules/ilo/lib/puppet/type/ilo_settings.rb    |   31 +
 .../puppet/modules/ilo/lib/puppet/type/ilo_user.rb |   81 +
 .../ilo/lib/puppet/util/network_device/ilo.rb      |    4 +
 .../lib/puppet/util/network_device/ilo/device.rb   |   28 +
 .../lib/puppet/util/network_device/ilo/facts.rb    |   23 +
 .../puppet/util/network_device/ilo/transport.rb    |  124 +
 examples/puppet/modules/ilo/manifests/init.pp      |   20 +
 .../puppet/modules/ilo/templates/ilo-device.erb    |    8 +
 hpilo.py                                           |  693 ++----
 hpilo_cli                                          |   54 +-
 hpilo_fw.py                                        |   13 +-
 ilo.conf.example                                   |   11 +-
 setup.py                                           |    7 +-
 120 files changed, 6204 insertions(+), 1301 deletions(-)

diff --git a/CHANGES b/CHANGES
index 70c482f..a1b398a 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,52 @@
+Version 3.6, 2016-01-29
+* Actually fix mod_snmp_im_settings' cpability of setting ro/trap communities
+
+Version 3.5, 2016-01-29
+* Restore python 2.4 compatibility, which broke in 3.0
+
+Version 3.4, 2015-12-20
+* Bugfixes in set_ers_direct_connect and get_persistent_boot
+* xmldata now also supports querying for license keys
+
+Version 3.3, 2015-10-14
+* A puppet module has been added
+* More error codes get their own exception classes
+* Passing incorrect arguments to hpilo_cli now causes it to consistently exit
+  with a nonzero exitcode
+* A bug in dealing with SSL errors was fixed
+* When saving responses retrieved using the ILO_LOCAL protocol, the
+  garbage data added by hponcfg is now properly removed
+
+Version 3.2, 2015-10-11
+* When reading responses saved earlier, the protocol is now detected properly
+* A new testsuite has been written
+* Various bugs were fixed
+* More error codes get their own exception classes
+
+Version 3.1, 2015-10-06
+* hpilo_ca now creates sha256 signatures
+* hpilo_ca now includes the localityName in certificates
+
+Version 3.0, 2015-10-05
+* Major version bump as we're now dual licensed under GPL 3+ and APL at HP's
+  request, mainly for using hpilo.py with OpenStack
+* Add more example applications: an elasticsearch importer and an automatic
+  firmware updater
+* Modernize the hpilo_ca example
+* hpilo_cli now understands --version, and hpilo.py has a __version__ attribute
+* All development tools are moved to a subdir
+* SSL certificate errors are now ignored under python 2.7.9+ and 3.5+ as well
+* Add 'download_rib_firmware all all' to create a firmware mirror
+
+Version 2.13, 2015-04-13
+
+* We will now find hponcfg on you $PATH
+* Major documentation overhaul
+* hpilo_ca has been moved to examples/
+* the xmldata can now also be used to query chassis onboard administrators
+* get_persistent_boot bow supports uEFI booting
+
+
 Version 2.12, 2015-04-07
 
 * Proliant gen9 compatibility fixes
diff --git a/COPYING b/COPYING
index 35da715..6095261 100644
--- a/COPYING
+++ b/COPYING
@@ -1,15 +1,18 @@
 python-hpilo - Manage iLO interfaces from python code
-Copyright (C) 2011-2015 Dennis Kaarsemaker <dennis at kaarsemaker.net>
+Copyright (C) 2011-2016 Dennis Kaarsemaker <dennis at kaarsemaker.net>
 
 This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
+it under the terms of (at your option) either the Apache License,
+Version 2.0, or the GNU General Public License as published by the
+Free Software Foundation, either version 3 of the License, or (at your
+option) any later version.
 
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
-You should have received a copy of the GNU General Public License
-along with this program.  If not, see <http://www.gnu.org/licenses/>.
+For details and specific language governing permissions and
+limitations, see either
+
+ - http://www.gnu.org/licenses/ for the GNU GPL
+ - http://www.apache.org/licenses/LICENSE-2.0 for the Apache license
diff --git a/PKG-INFO b/PKG-INFO
index 3d6d7c6..e5ca713 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,7 +1,7 @@
 Metadata-Version: 1.1
 Name: python-hpilo
-Version: 2.12.1
-Summary: Accessing HP iLO interfaces from python
+Version: 3.6
+Summary: iLO automation from python or shell
 Home-page: http://github.com/seveas/python-hpilo
 Author: Dennis Kaarsemaker
 Author-email: dennis at kaarsemaker.net
@@ -12,6 +12,7 @@ Classifier: Development Status :: 5 - Production/Stable
 Classifier: Intended Audience :: Developers
 Classifier: Intended Audience :: System Administrators
 Classifier: License :: OSI Approved :: GNU General Public License (GPL)
+Classifier: License :: OSI Approved :: Apache Software License
 Classifier: Programming Language :: Python
 Classifier: Programming Language :: Python :: 3
 Classifier: Topic :: System :: Hardware
diff --git a/README b/README
deleted file mode 100644
index 1e79b48..0000000
--- a/README
+++ /dev/null
@@ -1,39 +0,0 @@
-Accessing HP iLO interfaces from python
-=======================================
-
-This module will make it easy for you to access the Integrated Lights Out
-management interface of your HP hardware. It supports RILOE II, iLO, iLO 2, iLO
-3 and iLO 4. It uses the XML interface or hponcfg to access and change the iLO.
-
-HP, Integrated Lights out and iLO are trademarks of HP, with whom the author of
-this software is not affiliated in any way other than using some of their
-hardware.
-
-Installing
-----------
-
-The software is easy to install from github:
-
-$ git clone git://github.com/seveas/python-hpilo
-$ cd python-hpilo
-$ python setup.py install
-
-The minimum python version supported is 2.4. Python 3 is also supported.
-
-Binary packages for various distribution are available too. See the
-documentation linked below for install instructions for Fedora, RHEL/CentOS,
-Debian and Ubuntu.
-
-Usage
------
-See docs/*.rst or the documentation on http://packages.python.org/python-hpilo/
-for API documentation and examples.
-
-Author and license
-------------------
-This software is (c) 2011-2013 Dennis Kaarsemaker <dennis at kaarsemaker.net>
-
-This program is free software: you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation, either version 3 of the License, or (at your option) any later
-version.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..d3a1aec
--- /dev/null
+++ b/README.md
@@ -0,0 +1,64 @@
+iLO automation from python or shell
+===================================
+
+HP servers come with a powerful out of band management interface called
+Integrated Lights out, or iLO. It has an extensive web interface and
+commercially available tools for centrally managing iLO devices and their
+servers.
+
+But if you want to built your own tooling, integrate iLO management to your
+existing procedures or simply want to manage iLOs using a command-line
+interface, you're stuck manually creating XML files and using a perl hack HP
+ships called locfg.pl.
+
+Enter python-hpilo!
+
+Using the same XML interface as HP's own management tools, here is a python
+library and command-line tool that make it a lot easier to do all the above. No
+manual XML writing, just call functions from either python or your
+shell(script).
+
+Usage
+-----
+Full usage documentation can be found on http://seveas.github.io/python-hpilo/
+or in the docs/ directory in the python-hpilo tarball. Here are some examples
+to wet your appetite:
+
+Getting the chassis IP of a blade server, from python:
+
+    >>> ilo = hpilo.Ilo('example-server.int.kaarsemaker.net')
+    >>> chassis = ilo.get_oa_info()
+    >>> print chassis['ipaddress']
+    10.42.128.101
+
+Entering a license key and creating a user, from the shell:
+
+    $ hpilo_cli example-server.int.kaarsemaker.net activate_license key=$mykey
+    $ hpilo_cli example-server.int.kaarsemaker.net add_user user_login=dennis \
+                password=hunter2 admin_priv=true
+
+Compatibility
+-------------
+This module is written with compatibility as main priority. Currently supported
+are:
+
+* All RILOE II/iLO versions up to and including iLO 4
+* Python 2.4-2.7 and python 3.2 and newer
+* Any operating system Python runs on
+
+iLOs can be managed both locally using `hponcfg` or remotely using the iLO's
+built-in webserver. In the latter case, the requirements above concern the
+machine you run this code on, not the managed server.
+
+Author and license
+------------------
+This software is (c) 2011-2014 Dennis Kaarsemaker <dennis at kaarsemaker.net>
+
+This program is free software: you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free Software
+Foundation, either version 3 of the License, or (at your option) any later
+version.
+
+HP, Integrated Lights out and iLO are trademarks of HP, with whom the author of
+this software is not affiliated in any way other than using some of their
+hardware.
diff --git a/docs/_static/kibana.png b/docs/_static/kibana.png
new file mode 100644
index 0000000..45816ed
Binary files /dev/null and b/docs/_static/kibana.png differ
diff --git a/docs/_static/lightbulb.png b/docs/_static/lightbulb.png
deleted file mode 100644
index cb4f5b3..0000000
Binary files a/docs/_static/lightbulb.png and /dev/null differ
diff --git a/docs/_static/python-hpilo.png b/docs/_static/python-hpilo.png
new file mode 100644
index 0000000..8f78890
Binary files /dev/null and b/docs/_static/python-hpilo.png differ
diff --git a/docs/ahs.rst b/docs/ahs.rst
new file mode 100644
index 0000000..bba62e1
--- /dev/null
+++ b/docs/ahs.rst
@@ -0,0 +1,25 @@
+Active Health System and Insight Remote Support
+===============================================
+The Active Health System and Insight Remote Support functions let you collect
+information about your server environment in a central place. These functions
+let you inspect and manipulate the AHS and ERS configuration and submit data.
+
+.. py:currentmodule:: hpilo
+
+.. class:: Ilo
+   :noindex:
+
+   .. automethod:: get_ahs_status
+   .. ilo_output:: get_ahs_status
+   .. automethod:: set_ahs_status
+   .. automethod:: ahs_clear_data
+   .. automethod:: get_ers_settings
+   .. ilo_output:: get_ers_settings
+   .. automethod:: set_ers_irs_connect
+   .. automethod:: set_ers_direct_connect
+   .. automethod:: dc_registration_complete
+   .. automethod:: set_ers_web_proxy
+   .. automethod:: ers_ahs_submit
+   .. automethod:: trigger_l2_collection
+   .. automethod:: trigger_test_event
+   .. automethod:: disable_ers
diff --git a/docs/authentication.rst b/docs/authentication.rst
new file mode 100644
index 0000000..e2fc241
--- /dev/null
+++ b/docs/authentication.rst
@@ -0,0 +1,35 @@
+Authentication settings
+=======================
+
+By default, an iLO has only one user account: Administrator. But via the API
+you can create more users and manipulate them. It's also possible to import SSH
+keys, configure kerberos settings and configure single-sign on. Some methods
+accept a lot of arguments, for details on what these arguments mean, I will
+refer to the `ilo scripting guide`_.
+
+.. _`ilo scripting guide`: http://www.hp.com/support/ilo4_cli_gde_en
+
+.. py:currentmodule:: hpilo
+
+.. class:: Ilo
+   :noindex:
+
+   .. automethod:: get_all_users
+   .. ilo_output:: get_all_users
+   .. automethod:: get_all_user_info
+   .. ilo_output:: get_all_user_info
+   .. automethod:: get_user
+   .. ilo_output:: get_user
+   .. automethod:: add_user
+   .. automethod:: mod_user
+   .. automethod:: delete_user
+   .. automethod:: import_ssh_key
+   .. automethod:: delete_ssh_key
+   .. automethod:: get_dir_config
+   .. ilo_output:: get_dir_config
+   .. automethod:: mod_dir_config
+   .. automethod:: get_sso_settings
+   .. ilo_output:: get_sso_settings
+   .. automethod:: mod_sso_settings
+   .. automethod:: get_twofactor_settings
+   .. ilo_output:: get_twofactor_settings
diff --git a/docs/autofirmware.rst b/docs/autofirmware.rst
new file mode 100644
index 0000000..7043c75
--- /dev/null
+++ b/docs/autofirmware.rst
@@ -0,0 +1,51 @@
+Automated firmware updates
+==========================
+Building on the :doc:`Elasticsearch </elasticsearch>` example, we can now build
+automated updates for iLO firmware. 
+
+The example application uses `beanstalk`_ and `azuki`_ to queue firmware
+updates and process them with as much parallelism as you want.
+
+Scheduling updates
+------------------
+If you run :command:`hpilo_firmware_update`, it will query elasticsearch to
+find iLOs with obsolete firmware and schedule updates. It's probably most
+useful to run this command in the same cronjob as the elasticsearch importer to
+schedule firmware updates as they come in.
+
+Checking the queue
+------------------
+Using the :command:`azuki` tool, you can check how many iLOs need to be upgraded::
+
+  $ azuki stats hpilo-upgrades
+  hpilo-upgrades
+  Connections:
+      Producers:   0
+      Consumers:   1
+      Waiting:     0
+  Jobs:
+      Delayed:     0
+      Ready:       1
+      Urgent:      0
+      Reserved:    1
+      Buried:      0
+      Deleted:     11
+      Total:       13
+
+Doing the upgrades
+------------------
+To process the queue, you again use azuki::
+
+   $ azuki daemon hpilo-upgrades
+   INFO:azuki:Waiting for job
+   Upgrading example-server-1.int.kaarsemaker.net (10.10.10.42) from ilo3 1.70 to ilo3 1.85
+   ...
+
+This will keep running and process new items as they come in. You'll probably
+want to run it in screen or tmux so it stays on in the background. If you have
+lots of iLOs to upgrade, you can start as many instances of this as you want,
+they will not step on each others toes. I regularly run up to 30 instances in
+parallel in a tmux session.
+
+.. _`beanstalk`: http://kr.github.io/beanstalkd/
+.. _`azuki`: http://github.com/seveas/azuki
diff --git a/docs/boot.rst b/docs/boot.rst
new file mode 100644
index 0000000..2282306
--- /dev/null
+++ b/docs/boot.rst
@@ -0,0 +1,30 @@
+Boot settings and rebooting
+===========================
+
+HP servers can boot in various ways and from many devices. The functions in
+this section let you manipulate bootup settings and reboot the server and the
+iLO. If you need to power off the server hard, take a look at the
+:doc:`power documentation </power>`.
+
+.. py:currentmodule:: hpilo
+
+.. class:: Ilo
+   :noindex:
+
+   .. automethod:: reset_rib
+   .. automethod:: reset_server
+   .. automethod:: cold_boot_server
+   .. automethod:: warm_boot_server
+   .. automethod:: get_one_time_boot
+   .. ilo_output:: get_one_time_boot
+   .. automethod:: set_one_time_boot
+   .. automethod:: get_persistent_boot
+   .. ilo_output:: get_persistent_boot
+   .. automethod:: set_persistent_boot
+   .. automethod:: get_supported_boot_mode
+   .. ilo_output:: get_supported_boot_mode
+   .. automethod:: get_current_boot_mode
+   .. ilo_output:: get_current_boot_mode
+   .. automethod:: get_pending_boot_mode
+   .. ilo_output:: get_pending_boot_mode
+   .. automethod:: set_pending_boot_mode
diff --git a/docs/ca.rst b/docs/ca.rst
index 68ec26b..a559f5f 100644
--- a/docs/ca.rst
+++ b/docs/ca.rst
@@ -2,20 +2,28 @@ Managing SSL certificates
 =========================
 
 When managing large amounts of iLO interfaces, the constant SSL warnings are a
-nuisance. Workarounds like `sslhazard for firefox`_ help, but it's much better
-to hapve proper SSL certificates. This script will make that easy to do for you
-by taking care of all the CA work.
+nuisance, so let's make sure we have proper SSL certificates. This script will
+make that easy to do for you by taking care of all the CA work. All you need to
+do is add the CA's certificate to your browsers trusted CA list.
 
 First thing to do is configure the CA. Add something like the following to your
 :file:`~/.ilo.conf`::
 
   [ca]
   path = ~/.hpilo_ca
+  country = NL
+  state = Flevoland
+  locality = Lelystad
+  organization = Kaarsemaker.net
+  organizational_unit = Sysadmin
 
 This path can point to an existing CA, the only requirement is that
-:file:`openssl.cnf` for this CA lives inside that directory. If the CA does not
-yet exist, you can create it as follows::
-  
+:file:`openssl.cnf` for this CA lives inside that directory. The other config
+values are used when generating the certificates for the iLOs and are all
+optional, they default to what HP puts in there.
+
+If the CA does not yet exist, you can create it as follows::
+
   $ hpilo_ca init
   Generating RSA private key, 2048 bit long modulus
   .+++
@@ -55,31 +63,31 @@ signed certificate. Here's an example of it at work::
   Check that the request matches the signature
   Signature ok
   Certificate Details:
-          Serial Number: 0 (0x0)
+          Serial Number: 4 (0x4)
           Validity
-              Not Before: Mar 10 13:38:11 2012 GMT
-              Not After : Mar  9 13:38:11 2017 GMT
+              Not Before: Oct  5 09:48:26 2015 GMT
+              Not After : Oct  3 09:48:26 2020 GMT
           Subject:
-              countryName               = US
-              stateOrProvinceName       = Texas
-              organizationName          = Hewlett-Packard Development Company
-              organizationalUnitName    = ISS
+              countryName               = NL
+              stateOrProvinceName       = Flevoland
+              organizationName          = Kaarsemaker.net
+              organizationalUnitName    = Sysadmin
               commonName                = example-server.int.kaarsemaker.net
           X509v3 extensions:
-              X509v3 Basic Constraints: 
+              X509v3 Basic Constraints:
                   CA:FALSE
-              X509v3 Subject Key Identifier: 
-                  85:7A:FB:A1:14:46:BA:EF:50:21:92:F9:36:E5:D4:F7:2D:97:F4:01
-              X509v3 Authority Key Identifier: 
-                  keyid:D5:C4:82:D2:92:28:D0:D9:39:0A:81:69:23:2C:76:4B:7D:2C:E2:2E
-  
-              Netscape Comment: 
+              X509v3 Subject Key Identifier:
+                  59:E5:B8:37:C5:30:8D:38:47:29:3E:C1:0E:B3:0A:97:95:48:3E:D1
+              X509v3 Authority Key Identifier:
+                  keyid:89:17:37:C5:E3:2D:EA:5C:83:0A:52:36:79:B0:EC:B7:A4:D5:D4:EF
+
+              Netscape Comment:
                   Certificate generated by iLO CA
-  Certificate is to be certified until Mar  9 13:38:11 2017 GMT (1825 days)
-  
+              X509v3 Subject Alternative Name
+                  DNS:example-server.int.kaarsemaker.net, DNS:example-server, IP Address:10.4.2.13
+  Certificate is to be certified until Oct  3 09:48:26 2020 GMT (1825 days)
+
   Write out database with 1 new entries
   Data Base Updated
   (4/5) Uploading certificate
   (5/5) Resetting iLO
-
-.. _`sslhazard for firefox`: https://github.com/seveas/sslhazard/
diff --git a/docs/conf.py b/docs/conf.py
index cc630ad..58b1241 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -18,6 +18,7 @@ import cloud_sptheme as csp
 # add these directories to sys.path here. If the directory is relative to the
 # documentation root, use os.path.abspath to make it absolute, like shown here.
 sys.path.insert(0, os.path.abspath('..'))
+sys.path.insert(0, os.path.abspath('.'))
 
 # -- General configuration -----------------------------------------------------
 
@@ -26,7 +27,7 @@ sys.path.insert(0, os.path.abspath('..'))
 
 # Add any Sphinx extension module names here, as strings. They can be extensions
 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
-extensions = ['sphinx.ext.autodoc']
+extensions = ['sphinx.ext.autodoc', 'ilodoc']
 
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['_templates']
@@ -42,16 +43,16 @@ master_doc = 'index'
 
 # General information about the project.
 project = u'python-hpilo'
-copyright = u'2011-2015, Dennis Kaarsemaker'
+copyright = u'2011-2016, Dennis Kaarsemaker'
 
 # The version info for the project you're documenting, acts as replacement for
 # |version| and |release|, also used in various other places throughout the
 # built documents.
 #
 # The short X.Y version.
-version = '2.12'
+version = '3.6'
 # The full version, including alpha/beta/rc tags.
-release = '2.12.1'
+release = '3.6'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
@@ -114,7 +115,7 @@ html_theme_path = [csp.get_theme_dir()]
 
 # The name of an image file (relative to this directory) to place at the top
 # of the sidebar.
-html_logo = '_static/lightbulb.png'
+html_logo = '_static/python-hpilo.png'
 
 # The name of an image file (within the static path) to use as favicon of the
 # docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
diff --git a/docs/contributing.rst b/docs/contributing.rst
index 84309d9..e1e221f 100644
--- a/docs/contributing.rst
+++ b/docs/contributing.rst
@@ -6,22 +6,27 @@ problem with the software, that's the place to file an issue. And if you want
 to contribute to the project, that's the place to go to as well.
 
 Patches can be submitted as pull requests on github or mailed to
-dennis at kaarsemaker.net. When you submit a patch, please make sure you test it
-too. The test tool is built into hpilo.py, read the comments for the _test
-function to find the details. When adding new methods, please add tests too.
+dennis at kaarsemaker.net.
+
+If you are looking for a really simple way of contributing, please contribute
+test data from a server model that's not included in the tests yet, see
+`tests/README` for more details.
 
 Coding guidelines
 -----------------
-* python-hpilo currently supports python 2.4 up to python 3.3. Any new code
-  needs to be compatible with all these versions. That means no `with`
-  statement, no `sorted` and using brackets for `print()`.
-* `pep 8`_ is to be followed, except for the maximum line length rule. Be
-  reasonable with your line lengths though
+* python-hpilo currently supports python 2.4 up to python 3.5. Any new code in
+  `hpilo.py` and `hpilo_cli` needs to be compatible with all these versions.
+  That means no `with` statement, no `sorted` and using brackets for `print()`.
+  Code in examples and tests can assume python 2.7 and 3.4 or newer.
+* No dependencies in `hpilo.py` and `hpilo_cli`. Examples may have additional
+  dependencies.
 * All methods call into :func:`_info_tag` or :func:`_control_tag`. Any
   new method must do so too, to be able to use it in :meth:`call_delayed`.
 * All new methods must be documented. A docstring is mandatory and will appear
   in the docs. For methods that return data, sample output must be added to the
   documentation too.
+* All new methods must be tested. You should add data for the xml
+  parser/generator tests and, if applicable, a test that manipulates the iLO.
+  See the `tests/README` file in the git repository for more details on tests.
 
 .. _GitHub: https://github.com/seveas/python-hpilo
-.. _`pep 8`: http://www.python.org/dev/peps/pep-0008/
diff --git a/docs/elasticsearch.rst b/docs/elasticsearch.rst
new file mode 100644
index 0000000..96faf4c
--- /dev/null
+++ b/docs/elasticsearch.rst
@@ -0,0 +1,50 @@
+iLO information search
+======================
+
+When managing large amounts of iLOs, it's often useful to be able to quickly
+search through iLO configuration data without having to query them all. The
+approach chosen in this example is to store all available information in
+elasticsearch.
+
+Storing information
+-------------------
+While the application can query the iLO itself, it does need to be told the
+names (or IP addresses, but names are recommended) of your iLO interfaces. To
+do this, you will need to create a `servers.py` file that will tell the
+application what it wants. An example `servers.py` is shipped with the
+application that simply returns a static list of hostnames, but you could do
+anything here. The author uses a variant that queries an asset database to get
+the iLO names for example.
+
+Once you have created `servers.py` to match your environment, you can run
+:command:`hpilo_es_import`. It will connect to elasticsearch on localhost and
+create an index named `hpilo`. If elasticsearch does not live on localhost, you
+can tell the application this in :file:`~/.ilo.conf`::
+
+  [elasticsearch]
+  host = elasticsearch.example.com
+
+The importer will then contact all your iLOs and call the `get_fw_version`,
+`get_host_data`, `get_global_settings`, `get_network_settings`,
+`get_all_user_info`, `get_oa_info` and `xmldata` methods to get a bunch of
+information from the iLO. All this is then stored in elasticsearch.
+
+Once you have this working, all that remains is to set up a cronjob to
+regularly run the importer to refresh the data.
+
+Retrieving information
+----------------------
+Of course data is useless if you cannot retrieve it. Since there is nothing
+special about the iLO data, you can fetch it from elasticsearch like you fetch
+any data from there. The example includes an application that dumps all data,
+but the most useful code here you will need to write yourself, or you can use a
+visualization tool like kibana to look at the data.
+
+Kibana dashboard
+----------------
+Kibana is a really powerful dashboard solution for elasticsearch. You can use
+it to get a quick overview of your iLO versions, settings and health data. You
+can find an example dashboard in the directory of this example application that
+you can import in your Kibana 4 instance.
+
+.. image:: _static/kibana.png
diff --git a/docs/federation.rst b/docs/federation.rst
new file mode 100644
index 0000000..7389d18
--- /dev/null
+++ b/docs/federation.rst
@@ -0,0 +1,23 @@
+Federation groups
+=================
+iLO federation allows you to manage multiple iLOs and servers from a single iLO
+web interface, including firmware updates, license installs and querying health
+status.
+
+.. py:currentmodule:: hpilo
+
+.. class:: Ilo
+   :noindex:
+
+   .. automethod:: add_federation_group
+   .. automethod:: get_federation_all_groups
+   .. ilo_output:: get_federation_all_groups
+   .. automethod:: get_federation_all_groups_info
+   .. ilo_output:: get_federation_all_groups_info
+   .. automethod:: get_federation_group
+   .. ilo_output:: get_federation_group
+   .. automethod:: mod_federation_group
+   .. automethod:: delete_federation_group
+   .. automethod:: get_federation_multicast
+   .. ilo_output:: get_federation_multicast
+   .. automethod:: set_federation_multicast
diff --git a/docs/firmware.rst b/docs/firmware.rst
index 31717f8..91e5a78 100644
--- a/docs/firmware.rst
+++ b/docs/firmware.rst
@@ -26,6 +26,7 @@ that too::
     hpilo_cli download_rib_firmware ilo4       # Download latest iLO 4 firmware
     hpilo_cli download_rib_firmware ilo4 1.50  # Download a specific firmware version
     hpilo_cli download_rib_firmware ilo4 all   # Download all firmware versions for iLO 4
+    hpilo_cli download_rib_firmware all all    # Download all firmware versions for all iLO types
 
 .. _`firmware.conf`: https://raw.githubusercontent.com/seveas/python-hpilo/master/firmware.conf
 
@@ -89,8 +90,7 @@ auto-update via cron) such a mirror with a simple shellscript::
 
     cd /var/www/html/ilo-firmware
     wget -q https://raw.githubusercontent.com/seveas/python-hpilo/master/firmware.conf
-    hpilo_cli -c /dev/null download_rib_firmware ilo3
-    hpilo_cli -c /dev/null download_rib_firmware ilo4
+    hpilo_cli -c /dev/null download_rib_firmware all all
 
 This will download and extract the necessary files to
 :file:`/var/www/html/ilo-firmware`.
diff --git a/docs/health.rst b/docs/health.rst
new file mode 100644
index 0000000..7ef76e1
--- /dev/null
+++ b/docs/health.rst
@@ -0,0 +1,15 @@
+Server health
+=============
+The iLO knows a lot about your server's physical health. The
+:meth:`get_embedded_health` method lets you retrieve all the health
+information, so you can act upon it, for example in monitoring checks and
+management scripts. Note that the returned data can differ significantly
+between iLO versions.
+
+.. py:currentmodule:: hpilo
+
+.. class:: Ilo
+   :noindex:
+
+   .. automethod:: get_embedded_health
+   .. ilo_output:: get_embedded_health
diff --git a/docs/ilo.rst b/docs/ilo.rst
deleted file mode 100644
index 7149f20..0000000
--- a/docs/ilo.rst
+++ /dev/null
@@ -1,23 +0,0 @@
-Ilo objects
-===========
-
-The :class:`Ilo` class encapsulates all functionality. It autodetects which iLO
-version is in use and will send the correct messages for that version. Its
-methods are divided into several categories below: getting information,
-changing settings and upgrading firmware.
-
-There are quite a few methods to get information about your server, its
-enclosing chassis or the iLO board itself. To see what they return, please
-refer to the :doc:`example output </output>`.
-
-Methods that manipulate the iLO, such as setting the servers name, or changing
-a users password do not have a return value.
-
-The exception :class:`IloError` is raised in case of errors that occur when
-communicating with the IlO. The subclass :class:`IloLoginFailed` is raised for
-login failures.
-
-.. py:currentmodule:: hpilo
-
-.. autoclass:: Ilo
-   :members:
diff --git a/docs/ilodoc.py b/docs/ilodoc.py
new file mode 100644
index 0000000..64ceb07
--- /dev/null
+++ b/docs/ilodoc.py
@@ -0,0 +1,37 @@
+from docutils.parsers.rst import Directive
+from docutils import nodes
+from sphinx.util.nodes import set_source_info
+import os
+import re
+import hpilo
+
+def setup(app):
+    app.add_directive('ilo_output', OutputDirective)
+
+class OutputDirective(Directive):
+    required_arguments = 1
+    optional_arguments = 0
+
+    def run(self):
+        method = self.arguments[0]
+        if '#' in method:
+            method, suffix = method.split('#')
+            suffix = '_' + suffix
+        else:
+            suffix = ''
+        assert re.match('^[a-zA-Z][a-zA-Z0-9_]*$', method)
+        srcdir = self.state.document.settings.env.srcdir
+        with open(os.path.join(srcdir, 'output', method + suffix)) as fd:
+            content = fd.read()
+        if '\n\n' in content:
+            params, result = content.split('\n\n')
+            params = ', '.join(params.split('\n'))
+        else:
+            params, result = '', content
+
+        out = ">>> ilo.%s(%s)\n%s" % (method, params, result)
+        literal = nodes.literal_block(out, out)
+        literal['language'] = 'python'
+        set_source_info(self, literal)
+        self.state.parent.children[-1].children[-1].append(literal)
+        return []
diff --git a/docs/index.rst b/docs/index.rst
index 1d20424..577122e 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -1,42 +1,131 @@
-Accessing HP iLO interfaces from python
-=======================================
+iLO automation from python or shell
+===================================
 
-This module will make it easy for you to access the Integrated Lights Out
-management interface of your HP hardware. It supports RILOE II, iLO, iLO 2, iLO
-3 and iLO 4. It uses the XML interface or hponcfg to access and change the iLO.
+HP servers come with a powerful out of band management interface called
+Integrated Lights out, or iLO. It has an extensive web interface and
+commercially available tools for centrally managing iLO devices and their
+servers.
 
-The complete API is described in the :doc:`iLO class API reference </ilo>`. All
-functions return structured data based on the XML returned by the iLO. See
-:doc:`the output reference </output>` for example return values.
+But if you want to built your own tooling, integrate iLO management to your
+existing procedures or simply want to manage iLOs using a command-line
+interface, you're stuck manually creating XML files and using a perl hack HP
+ships called locfg.pl.
 
-A command line interface to this module, :doc:`hpilo_cli </cli>` makes accessing iLO
-interfaces almost trivial and easy to integrate with non-python scripts.
+Enter python-hpilo!
 
-To make managing SSL certificates for iLO boards easier, you can use
-:doc:`hpilo_ca </ca>`.
+Using the same XML interface as HP's own management tools, here is a python
+library and command-line tool that make it a lot easier to do all the above. No
+manual XML writing, just call functions from either python or your
+shell(script).
 
-HP, Integrated Lights out and iLO are trademarks of HP, with whom the author of
-this software is not affiliated in any way other than using some of their
-hardware.
+Quick usage examples
+====================
+Full usage documentation can be found following the links below, but here are
+some examples to wet your appetite:
+
+Getting the chassis IP of a blade server, from python::
+
+    >>> ilo = hpilo.Ilo('example-server.int.kaarsemaker.net')
+    >>> chassis = ilo.get_oa_info()
+    >>> print chassis['ipaddress']
+    10.42.128.101
+
+Entering a license key and creating a user, from the shell:
+
+.. code-block:: console
+
+    $ hpilo_cli example-server.int.kaarsemaker.net activate_license key=$mykey
+    $ hpilo_cli example-server.int.kaarsemaker.net add_user user_login=dennis \
+                password=hunter2 admin_priv=true
+
+The available functions you can call are all documented in the pages linked
+below, but for detailed descriptions of all functions and especially their
+arguments, please refer to the `ilo scripting guide`_ as well.
 
-See also
---------
-More information about interacting with the iLO XML interface can be found in
-the sample XML files provided by HP on their `TechSupport site`_.
+This package also ships examples of more complete applications in the examples
+directory. This include an automated CA for managing SSL certificates, tooling
+to centralize iLO informatin in elastic search and an automated firmware
+updater. All of which are used in production by the author or other
+contributors.
 
-Contents:
-=========
+Compatibility
+=============
+This module is written with compatibility as main priority. Currently supported
+are:
 
+* All RILOE II/iLO versions up to and including iLO 4
+* Python 2.4-2.7 and python 3.2 and newer
+* Any operating system Python runs on
+
+iLOs can be managed both locally using `hponcfg` or remotely using the iLO's
+built-in webserver. In the latter case, the requirements above concern the
+machine you run this code on, not the managed server.
+
+Getting started
... 8048 lines suppressed ...

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-hpilo.git



More information about the Python-modules-commits mailing list