Introduce "slapos node register" script.

Squashed commit of the following:

commit a9aa690c5b74de55fed2499cbe6a2a205fbc2550
Author: Cédric Le Ninivin <cedric.leninivin@tiolive.com>
Date:   Fri Aug 17 10:18:14 2012 +0200

    Introduce use of logger

commit a36d37f766062eb5faed1e179d64a6c6a2bc2e50
Author: Cédric Le Ninivin <cedric.leninivin@tiolive.com>
Date:   Thu Aug 16 19:05:09 2012 +0200

    update copyright from 2010 to 2012

commit 167c2a83d45a5e1ca88dab806a5612e981aaf6a9
Author: Cédric Le Ninivin <cedric.leninivin@tiolive.com>
Date:   Thu Aug 16 19:02:56 2012 +0200

    Add dry run control in saving old configuration

commit 80eecf880c214c96d780547e95c447d794a87c0e
Author: Cédric Le Ninivin <cedric.leninivin@tiolive.com>
Date:   Thu Aug 16 19:00:35 2012 +0200

    Clean code

commit 359cf29263e72f2070659d7fdc1ba227dff85426
Author: Cédric Le Ninivin <cedric.leninivin@tiolive.com>
Date:   Thu Aug 16 18:51:43 2012 +0200

    Moved comments to docs

commit 84077e2a926b7d8fdf2495001df9378a301b5bbd
Merge: 42f2b2d 8d7ba61
Author: Cédric Le Ninivin <cedric.leninivin@tiolive.com>
Date:   Thu Aug 16 18:46:52 2012 +0200

    Merge remote-tracking branch 'origin/register' into register

commit 42f2b2dae626dfa7ef54f2df97e21d089e5890d7
Author: Cédric Le Ninivin <cedric.leninivin@tiolive.com>
Date:   Thu Aug 16 18:46:31 2012 +0200

    Moved register.py to register/

commit 8d7ba617c3d0697683eff48aee8401067d23c413
Author: Cédric Le Ninivin <cedric.leninivin@tiolive.com>
Date:   Thu Aug 16 10:48:48 2012 +0200

    Display error if wrong usage

commit 927d395f2f3e1f01085c38ea681f16034182e2bd
Author: Cédric Le Ninivin <cedric.leninivin@tiolive.com>
Date:   Tue Aug 14 14:57:33 2012 +0200

    Added created_tap = false in slapos.cfg

commit 49669afd0514f01b4720f94137c1f76cc47b4904
Author: Cédric Le Ninivin <cedric.leninivin@tiolive.com>
Date:   Tue Aug 14 12:05:07 2012 +0200

    If a slapos.old file is find, backup will be made in slapos.old.i
    Where i is the lower integer available starting at 1

commit 430406f39753af3f2de26e5a631350c5fb997a3a
Author: Cédric Le Ninivin <cedric.leninivin@tiolive.com>
Date:   Tue Aug 14 11:04:11 2012 +0200

    Can pass login and password in command line argument

commit 50b19497981d274f327fbe44c619a221539697aa
Author: Cédric Le Ninivin <cedric.leninivin@tiolive.com>
Date:   Thu Aug 9 11:49:29 2012 +0200

    Solved bug in writting interface in slapos.cfg

commit 27fe79c859a65095493303da7f81ace0c3643641
Author: Cédric Le Ninivin <cedric.leninivin@tiolive.com>
Date:   Thu Aug 9 10:51:10 2012 +0200

    Added option to modify master webservice url for computer registration

commit 9ed75848324789bb01404592780ba7cd2ab65f3c
Author: Cédric Le Ninivin <cedric.leninivin@tiolive.com>
Date:   Thu Aug 9 10:17:28 2012 +0200

    Removed useless recursive include in MANIFEST.in

commit 6b2d90c0b8149872b56dc9b565cb4800c3183594
Author: Cédric Le Ninivin <cedric.leninivin@tiolive.com>
Date:   Thu Aug 9 10:08:31 2012 +0200

    removed useless parameters in Option function call

commit 34083f2351570a1413bffb18db05bd17a6a8a18c
Author: Cédric Le Ninivin <cedric.leninivin@tiolive.com>
Date:   Thu Aug 9 10:06:07 2012 +0200

    removed useless '/'.join in os.path.join

commit 8408a213e655cc9030493d8a4695a4e4c0380c30
Author: Cédric Le Ninivin <cedric.leninivin@tiolive.com>
Date:   Thu Aug 9 09:53:07 2012 +0200

    Withdraw unused module from code

commit 2805cf2a9927e0b09a60984f7255423602e37e31
Author: Cédric Le Ninivin <cedric.leninivin@tiolive.com>
Date:   Wed Aug 8 16:17:31 2012 +0200

    Fixed forgotten code

commit 35e0b0ba9c6a7a9782a895b7ff74ab1294d1cad2
Author: Cédric Le Ninivin <cedric.leninivin@tiolive.com>
Date:   Wed Aug 8 15:53:50 2012 +0200

    Added slapos entry point, just giving acces to register script now

commit d2456a5a5f9135176498ac40088850627e21f88c
Author: Cédric Le Ninivin <cedric.leninivin@tiolive.com>
Date:   Wed Aug 8 11:46:34 2012 +0200

    Register function is now made to run in command line
    ipv6 interface option added

commit 71bc5c9edae00502cf09abaac4a4d70be96d4a9a
Author: Cédric Le Ninivin <cedric.leninivin@tiolive.com>
Date:   Tue Aug 7 17:40:56 2012 +0200

    Added creation partition_pki repertory

commit e80fede661858f98d0508bf61c4489b2e174882e
Author: Cédric Le Ninivin <cedric.leninivin@tiolive.com>
Date:   Tue Aug 7 17:01:23 2012 +0200

    Introducing independant register function that saves configuration in /etc/opt/slapos/slapos.cfg
parent a630757b
......@@ -58,6 +58,7 @@ setup(name=name,
'slapgrid-supervisord = slapos.grid.svcbackend:supervisord',
'slapproxy = slapos.proxy:main',
'bang = slapos.bang:main',
'slapos = slapos.slapos:main',
]
},
test_suite="slapos.tests",
......
# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
try:
__import__('pkg_resources').declare_namespace(__name__)
except ImportError:
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
This diff is collapsed.
[slapos]
software_root = /opt/slapgrid
instance_root = /srv/slapgrid
master_url = %(master_url)s
computer_id = %(computer_id)s
key_file = %(key_file)s
cert_file = %(cert_file)s
certificate_repository_path = %(certificate_repository_path)s
[slapformat]
interface_name = %(interface)s
computer_xml = /opt/slapos/slapos.xml
log_file = /opt/slapos/slapformat.log
create_tap = false
partition_amount = %(partition_amount)s
partition_base_name = slappart
user_base_name = slapuser
tap_base_name = slaptap
# You can choose any other local network which does not conflict with your
# current machine configuration
ipv4_local_network = %(ipv4_network)s
%(ipv6_interface)s
[networkcache]
# Define options for binary cache, used to download already compiled software.
download-binary-cache-url = http://www.shacache.org/shacache
download-cache-url = https://www.shacache.org/shacache
download-binary-dir-url = http://www.shacache.org/shadir
# List of signatures of uploaders we trust:
# Romain Courteaud
# Sebastien Robin
# Kazuhiko Shiozaki
# Cedric de Saint Martin
# Yingjie Xu
# Gabriel Monnerat
# Łukasz Nowak
signature-certificate-list =
-----BEGIN CERT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mI=
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIB9jCCAV+gAwIBAgIJAMNZBmoIOXPBMA0GCSqGSIb3DQEBBQUAMBMxETAPBgNV
BAMMCENPTVAtMTMyMCAXDTEyMDUwMjEyMDQyNloYDzIxMTIwNDA4MTIwNDI2WjAT
MREwDwYDVQQDDAhDT01QLTEzMjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA
6peZQt1sAmMAmSG9BVxxcXm8x15kE9iAplmANYNQ7z2YO57c10jDtlYlwVfi/rct
xNUOKQtc8UQtV/fJWP0QT0GITdRz5X/TkWiojiFgkopza9/b1hXs5rltYByUGLhg
7JZ9dZGBihzPfn6U8ESAKiJzQP8Hyz/o81FPfuHCftsCAwEAAaNQME4wHQYDVR0O
BBYEFNuxsc77Z6/JSKPoyloHNm9zF9yqMB8GA1UdIwQYMBaAFNuxsc77Z6/JSKPo
yloHNm9zF9yqMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAl4hBaJy1
cgiNV2+Z5oNTrHgmzWvSY4duECOTBxeuIOnhql3vLlaQmo0p8Z4c13kTZq2s3nhd
Loe5mIHsjRVKvzB6SvIaFUYq/EzmHnqNdpIGkT/Mj7r/iUs61btTcGUCLsUiUeci
Vd0Ozh79JSRpkrdI8R/NRQ2XPHAo+29TT70=
-----END CERTIFICATE-----
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2012 Vifib SARL and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly advised to contract a Free Software
# Service Company
#
# 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.
#
# 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.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import sys
from register.register import main as node_register
def main():
if len(sys.argv) < 3:
print "Usage: slapos node register NODE_NAME [options]"
print "%s: error: Incorrect number of arguments" % sys.argv[0]
return 0
"Run default configuration."
if sys.argv[1] == "node" and sys.argv[2] == "register":
sys.argv=sys.argv[2:]
node_register()
else :
print "Usage: slapos node register NODE_NAME [options]"
print "%s: error: Incorrect arguments" % sys.argv[0]
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment