[Python-apps-commits] r9410 - in packages/slapos.core/trunk/debian (17 files)
arnau at users.alioth.debian.org
arnau at users.alioth.debian.org
Thu Feb 7 03:00:28 UTC 2013
Date: Thursday, February 7, 2013 @ 03:00:21
Author: arnau
Revision: 9410
New upstream release (0.34).
Added:
packages/slapos.core/trunk/debian/patches/do_not_use_debian_zc.buildout.patch
packages/slapos.core/trunk/debian/patches/slapos_command_split_up.patch
Modified:
packages/slapos.core/trunk/debian/changelog
packages/slapos.core/trunk/debian/conf/slapos-client.cfg
packages/slapos.core/trunk/debian/conf/slapos-node-unofficial.cfg
packages/slapos.core/trunk/debian/control
packages/slapos.core/trunk/debian/patches/series
packages/slapos.core/trunk/debian/patches/system_configuration_file_by_default.patch
packages/slapos.core/trunk/debian/pydist-overrides
packages/slapos.core/trunk/debian/rules
packages/slapos.core/trunk/debian/slapos-client.install
packages/slapos.core/trunk/debian/slapos-client.postinst
packages/slapos.core/trunk/debian/slapos-client.postrm
packages/slapos.core/trunk/debian/slapos-node-unofficial.docs
packages/slapos.core/trunk/debian/slapos-node-unofficial.install
packages/slapos.core/trunk/debian/slapos-node-unofficial.postinst
packages/slapos.core/trunk/debian/slapos-node-unofficial.postrm
Modified: packages/slapos.core/trunk/debian/changelog
===================================================================
--- packages/slapos.core/trunk/debian/changelog 2013-02-04 13:15:18 UTC (rev 9409)
+++ packages/slapos.core/trunk/debian/changelog 2013-02-07 03:00:21 UTC (rev 9410)
@@ -1,7 +1,22 @@
-slapos.core (0.31.2-1) UNRELEASED; urgency=low
+slapos.core (0.34-1) unstable; urgency=low
* New upstream release.
+ + debian/slapos-client.install: new "cache" command.
+ + debian/pydist-overrides, debian/control:
+ - Do not add pyflakes and unittest2 to Depends (required for
+ tests only), rather add them to Suggests.
+ + A new command was introduced, slapos, which allows one to specify
+ node subcommands, but this should only be available if
+ slapos-node-unofficial package is installed.
+ - Add debian/patches/slapos_command_split_up.patch.
+ - debian/slapos-client.install: add "entry" file.
+ debian/patches/system_configuration_file_by_default.patch: Update.
+ + Add debian/patches/do_not_use_debian_zc.buildout.patch:
+ - zc.buildout seems to have been wrongly re-introduced as a dependency.
+ + debian/slapos-node-unofficial.docs:
+ - Add README.proxy.txt not empty anymore.
+ + Refresh debian/conf/slapos*.cfg.
+ * Use ucf to manage /etc/slapos/*.cfg configuration files.
* debian/control:
+ slapos-node-unofficial must depend on the current version of
slapos-client, otherwise pkg_resources fails when checking version.
@@ -10,8 +25,11 @@
+ Specify ``--logfile'' and ``--pidfile'' for slapgrid commands.
* debian/conf/slapos-node-unofficial.cfg:
+ Enable shacache for building Software Releases.
+ * debian/rules:
+ + Prevent *.cfg example files to be compressed as they are used as
+ templates during installation.
- -- Arnaud Fontaine <arnau at debian.org> Fri, 07 Sep 2012 18:48:21 +0900
+ -- Arnaud Fontaine <arnau at debian.org> Thu, 07 Feb 2013 11:58:44 +0900
slapos.core (0.25-2) unstable; urgency=low
Modified: packages/slapos.core/trunk/debian/conf/slapos-client.cfg
===================================================================
--- packages/slapos.core/trunk/debian/conf/slapos-client.cfg 2013-02-04 13:15:18 UTC (rev 9409)
+++ packages/slapos.core/trunk/debian/conf/slapos-client.cfg 2013-02-07 03:00:21 UTC (rev 9410)
@@ -1,27 +1,33 @@
+# Original version:
+# http://git.erp5.org/gitweb/slapos.core.git/blob_plain/2d8c4212357b4948e3d11e1360473edf8b28fe9a:/slapos-client.cfg.example
[slapos]
-master_url = http://127.0.0.1:5000
+master_url = https://slap.vifib.com/
[slapconsole]
-#key_file = /etc/slapos/ssl/slapos.key
-#cert_file = /etc/slapos/ssl/slapos.crt
+# Put here retrieved certificate from vifib.
+# Beware: put certificate from YOUR account, not the one from your node.
+# You (as identified person from vifib) will request an instance, node your node.
+# Conclusion: node certificate != person certificate.
+#cert_file = certificate file location coming from your slapos master account
+#key_file = key file location coming from your slapos master account
+# Below are software supported by Vifib
alias =
- dotclear https://svn.erp5.org/repos/public/slapos/trunk/software_release.contribution/dotclear.Kinwai.YIP/software.cfg
- erp5 http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/slapos-0.40:/software/erp5/software.cfg
+ apache_frontend http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/apache-frontend/software.cfg
+ drupal http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/slapos-0.141:/software/erp5/software.cfg
+ erp5 http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/slapos-0.117:/software/erp5/software.cfg
erp5scalabilitytestbed http://git.erp5.org/gitweb/slapos.git/blob_plain/erp5scalabilitytestbed:/software/erp5scalabilitytestbed/software.cfg
erp5_branch http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/heads/erp5:/software/erp5/software.cfg
- factux https://www.tiolive.com/vifib/P-OSOE.Factux.Wilfried.Rodrigues/Base_download
- joomla https://svn.erp5.org/repos/public/slapos/trunk/software_release.contribution/joomla.Christophe.Laroulandie/software.cfg
- kumofs http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/slapos-0.21:/software/kumofs/software.cfg
- kvm http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/slapos-0.43:/software/kvm/software.cfg
- lightforum https://svn.erp5.org/repos/public/slapos/trunk/software_release.contribution/lightforum.Christophe.Lefloch/software.cfg
+ kumofs http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/slapos-0.64:/software/kumofs/software.cfg
+ kvm http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/slapos-0.137:/software/kvm/software.cfg
mariadb http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/slapos-0.16-hotfix:/software/mariadb/software.cfg
memcached http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/slapos-0.43:/software/memcached/software.cfg
- mysql http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/slapos-0.47:/software/mysql-5.1/software.cfg
- nbd http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/slapos-0.35:/software/nbd/software.cfg
+ mysql http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/slapos-0.65:/software/mysql-5.1/software.cfg
nosqltester http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/heads/nosqltestbed:/software/nosqltestbed/software.cfg
- respest https://www.tiolive.com/vifib/P-OSOE.Respest.BENHAMED/Base_download
- slaposwebrunner http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/slapos-0.17:/software/slaprunner/software.cfg
- testnode http://git.erp5.org/gitweb/slapos.git/blob_plain/testnode:/software/testnode/software.cfg
- vifib http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/slapos-0.30:/software/vifib/software.cfg
+ postgresql http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/slapos-0.145:/software/postgres/software.cfg
+ slaposwebrunner http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/slapos-0.66:/software/slaprunner/software.cfg
+ wordpress http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/slapos-0.141:/software/wordpress/software.cfg
xwiki http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/slapos-0.46:/software/xwiki/software.cfg
- zabbixagent http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/slapos-0.5:/software/zabbix-agent/software.cfg
+ zabbixagent http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/slapos-0.95:/software/zabbix-agent/software.cfg
+
+[networkcache]
+download-binary-dir-url = http://www.shacache.org/shadir
Modified: packages/slapos.core/trunk/debian/conf/slapos-node-unofficial.cfg
===================================================================
--- packages/slapos.core/trunk/debian/conf/slapos-node-unofficial.cfg 2013-02-04 13:15:18 UTC (rev 9409)
+++ packages/slapos.core/trunk/debian/conf/slapos-node-unofficial.cfg 2013-02-07 03:00:21 UTC (rev 9410)
@@ -1,3 +1,5 @@
+# Original version:
+# http://git.erp5.org/gitweb/slapos.core.git/blob_plain/2d8c4212357b4948e3d11e1360473edf8b28fe9a:/slapos.cfg.example
[slapos]
software_root = /var/lib/slapos/software
instance_root = /var/lib/slapos/instance
@@ -160,8 +162,15 @@
5pW18Ry5Ie7iFK4cQMerZwWPxBodEbAteYlRsI6kePV7Gf735Y1RpuN8qZ2sYL6e
x2IMeSwJ82BpdEI5niXxB+iT0HxhmR+XaMI=
-----END CERTIFICATE-----
-# List of URL(s) which shouldn't be installed from binary cache, separated by
-# commas. Any URL beginning by a blacklisted URL will be blacklisted as well.
-binary-cache-url-blacklist =
+# List of URL(s) which shouldn't be downloaded from binary cache.
+# Any URL beginning by a blacklisted URL will be blacklisted as well.
+download-from-binary-cache-url-blacklist =
http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD
- http://git.erp5.org/gitweb/slapos.core.git/blob_plain/refs/heads
+ http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/heads
+ /
+# List of URL(s) which shouldn't be uploaded into binary cache.
+# Any URL beginning by a blacklisted URL will be blacklisted as well.
+upload-to-binary-cache-url-blacklist =
+ http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD
+ http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/heads
+ /
Modified: packages/slapos.core/trunk/debian/control
===================================================================
--- packages/slapos.core/trunk/debian/control 2013-02-04 13:15:18 UTC (rev 9409)
+++ packages/slapos.core/trunk/debian/control 2013-02-07 03:00:21 UTC (rev 9410)
@@ -20,7 +20,11 @@
Conflicts: python-slapos.slap
Depends: ${misc:Depends},
${python:Depends},
- python-xmlmarshaller (>= 0.9.3~)
+ python-xmlmarshaller (>= 0.9.3~),
+ ucf
+# For tests only
+Suggests: python-unittest2,
+ pyflakes
Description: Client-side to request applications with SlapOS
SlapOS allows one to turn any application into SaaS (Software as a Service),
PaaS (Platform as a Service) or IaaS (Infrastructure as a Service) without
@@ -45,6 +49,7 @@
Depends: ${misc:Depends},
${python:Depends},
slapos-client (= ${binary:Version}),
+ ucf,
# slapos.format
bridge-utils,
uml-utilities,
Added: packages/slapos.core/trunk/debian/patches/do_not_use_debian_zc.buildout.patch
===================================================================
--- packages/slapos.core/trunk/debian/patches/do_not_use_debian_zc.buildout.patch (rev 0)
+++ packages/slapos.core/trunk/debian/patches/do_not_use_debian_zc.buildout.patch 2013-02-07 03:00:21 UTC (rev 9410)
@@ -0,0 +1,12 @@
+Index: slapos.core-0.34/setup.py
+===================================================================
+--- slapos.core-0.34.orig/setup.py 2013-02-06 16:37:20.351847494 +0900
++++ slapos.core-0.34/setup.py 2013-02-06 16:37:20.347847451 +0900
+@@ -43,7 +43,6 @@
+ 'xml_marshaller>=0.9.3', # to unmarshall/marshall python objects to/from
+ # XML
+ 'zope.interface', # slap library implementes interfaces
+- 'zc.buildout',
+ ] + additional_install_requires,
+ zip_safe=False, # proxy depends on Flask, which has issues with
+ # accessing templates
Modified: packages/slapos.core/trunk/debian/patches/series
===================================================================
--- packages/slapos.core/trunk/debian/patches/series 2013-02-04 13:15:18 UTC (rev 9409)
+++ packages/slapos.core/trunk/debian/patches/series 2013-02-07 03:00:21 UTC (rev 9410)
@@ -1 +1,3 @@
system_configuration_file_by_default.patch
+slapos_command_split_up.patch
+do_not_use_debian_zc.buildout.patch
Added: packages/slapos.core/trunk/debian/patches/slapos_command_split_up.patch
===================================================================
--- packages/slapos.core/trunk/debian/patches/slapos_command_split_up.patch (rev 0)
+++ packages/slapos.core/trunk/debian/patches/slapos_command_split_up.patch 2013-02-07 03:00:21 UTC (rev 9410)
@@ -0,0 +1,78 @@
+Author: Arnaud Fontaine <arnau at debian.org>
+Forwarded: not-needed
+Description: SlapOS Node subcommands are only available in slapos-node-unofficial
+ The Debian package is split up into two packages, thus ``slapos node ...''
+ subcommands are not available if slapos-node-unofficial is not installed.
+
+Index: slapos.core-0.34/slapos/entry.py
+===================================================================
+--- slapos.core-0.34.orig/slapos/entry.py 2013-02-07 10:42:46.645209016 +0900
++++ slapos.core-0.34/slapos/entry.py 2013-02-07 10:42:46.641208978 +0900
+@@ -30,19 +30,25 @@
+ import ConfigParser
+ import os
+ import sys
+-from slapos.bang import main as bang
+ from slapos.client import slapconsole as console
+ from slapos.client import request as request
+ from slapos.client import remove as remove
+ from slapos.client import supply as supply
+-from slapos.format import main as format
+ from slapos.cache import cache_lookup
+-from slapos.grid.slapgrid import runComputerPartition as instance
+-from slapos.grid.slapgrid import runSoftwareRelease as software
+-from slapos.grid.slapgrid import runUsageReport as report
+-from slapos.grid.svcbackend import supervisord
+-from slapos.grid.svcbackend import supervisorctl
+-from slapos.register.register import main as register
++
++try:
++ from slapos.bang import main as bang
++ from slapos.format import main as format
++ from slapos.grid.slapgrid import runComputerPartition as instance
++ from slapos.grid.slapgrid import runSoftwareRelease as software
++ from slapos.grid.slapgrid import runUsageReport as report
++ from slapos.grid.svcbackend import supervisord
++ from slapos.grid.svcbackend import supervisorctl
++ from slapos.register.register import main as register
++except ImportError:
++ SLAPOS_CLIENT_ONLY = True
++else:
++ SLAPOS_CLIENT_ONLY = False
+
+ # Note: this whole file is a hack. We should better try dedicated library
+ # like https://github.com/dhellmann/cliff or https://github.com/docopt/docopt.
+@@ -168,7 +174,7 @@
+ module responsible of the operation.
+ """
+ # If "node" arg is the first: we strip it and set a switch
+- if len(sys.argv) > 1 and sys.argv[1] == "node":
++ if len(sys.argv) > 1 and sys.argv[1] == "node" and not SLAPOS_CLIENT_ONLY:
+ sys.argv.pop(1)
+ # Hackish way to show status if no argument is specified
+ if len(sys.argv) is 1:
+@@ -179,12 +185,24 @@
+
+ usage = """SlapOS command line interface.
+ For more informations, refer to SlapOS documentation.
++"""
++
++ if SLAPOS_CLIENT_ONLY:
++ usage += """
++*****IMPORTANT NOTE*****: "node" subcommands are not available because
++"slapos-node-unofficial" Debian package is not installed.
++"""
+
++ usage += """
+ Client subcommands usage:
+ slapos request <instance-name> <software-url> [--configuration arg1=value1 arg2=value2 ... argN=valueN]
+ slapos supply <software-url> <node-id>
+ slapos console
+ slapos cache-lookup <software-url-or-md5>
++"""
++
++ if not SLAPOS_CLIENT_ONLY:
++ usage += """
+ Node subcommands usage:
+ slapos node
+ slapos node register <node-id>
Modified: packages/slapos.core/trunk/debian/patches/system_configuration_file_by_default.patch
===================================================================
--- packages/slapos.core/trunk/debian/patches/system_configuration_file_by_default.patch 2013-02-04 13:15:18 UTC (rev 9409)
+++ packages/slapos.core/trunk/debian/patches/system_configuration_file_by_default.patch 2013-02-07 03:00:21 UTC (rev 9410)
@@ -6,11 +6,11 @@
on /etc/slapos/slapos-client.cfg and /etc/slapos/slapos-node-unofficial.cfg
generated upon package installation.
-Index: slapos.core-0.31.2/slapos/format.py
+Index: slapos.core-0.34/slapos/format.py
===================================================================
---- slapos.core-0.31.2.orig/slapos/format.py 2012-09-27 20:03:22.000000000 +0900
-+++ slapos.core-0.31.2/slapos/format.py 2012-10-03 12:27:00.929310581 +0900
-@@ -885,8 +885,10 @@
+--- slapos.core-0.34.orig/slapos/format.py 2013-02-07 10:48:24.688511393 +0900
++++ slapos.core-0.34/slapos/format.py 2013-02-07 10:48:24.680511311 +0900
+@@ -884,8 +884,10 @@
else:
(options, args) = self.parse_args()
if len(args) != 1:
@@ -23,7 +23,7 @@
def run(config):
# Define the computer
-@@ -1193,7 +1195,11 @@
+@@ -1192,7 +1194,11 @@
global os
global callAndRead
real_callAndRead = callAndRead
@@ -36,19 +36,23 @@
# Parse arguments
options, configuration_file_path = Parser(usage=usage).check_args(args)
-Index: slapos.core-0.31.2/slapos/grid/slapgrid.py
+Index: slapos.core-0.34/slapos/grid/slapgrid.py
===================================================================
---- slapos.core-0.31.2.orig/slapos/grid/slapgrid.py 2012-10-02 18:47:21.000000000 +0900
-+++ slapos.core-0.31.2/slapos/grid/slapgrid.py 2012-10-03 12:27:00.929310581 +0900
-@@ -113,6 +113,7 @@
- parser.add_argument("--promise-timeout", type=int, default=3,
- help="Promise timeout in seconds.")
- parser.add_argument("configuration_file", nargs=1, type=argparse.FileType(),
-+ default='/etc/slapos/slapos-node-unofficial.cfg',
- help="SlapOS configuration file.")
- parser.add_argument("--maximal_delay", help="The maximal delay value in seconds. " \
- "A negative value leads start immediately.")
-@@ -142,7 +143,7 @@
+--- slapos.core-0.34.orig/slapos/grid/slapgrid.py 2013-02-07 10:48:24.688511393 +0900
++++ slapos.core-0.34/slapos/grid/slapgrid.py 2013-02-07 10:48:24.684511353 +0900
+@@ -145,8 +145,9 @@
+ "(ie.:slappartX, slappartY),"
+ "this option will make all others computer partitions be ignored.")
+
+- parser.add_argument("configuration_file", nargs=1, type=argparse.FileType(),
+- help="SlapOS configuration file.")
++ parser.add_argument("configuration_file", nargs='?', type=argparse.FileType(),
++ help="SlapOS configuration file.",
++ default='/etc/slapos/slapos-node-unofficial.cfg')
+
+ # Deprecated options
+ parser.add_argument("--develop", action="store_true", default=False,
+@@ -168,7 +169,7 @@
parser.parse_args(list(argument_tuple))
# Parses arguments from config file, if needed, then merge previous arguments
option_dict = {}
@@ -57,10 +61,10 @@
# Loads config (if config specified)
slapgrid_configuration = ConfigParser.SafeConfigParser()
slapgrid_configuration.readfp(configuration_file)
-Index: slapos.core-0.31.2/slapos/proxy/__init__.py
+Index: slapos.core-0.34/slapos/proxy/__init__.py
===================================================================
---- slapos.core-0.31.2.orig/slapos/proxy/__init__.py 2012-09-25 21:55:43.000000000 +0900
-+++ slapos.core-0.31.2/slapos/proxy/__init__.py 2012-10-03 12:27:00.929310581 +0900
+--- slapos.core-0.34.orig/slapos/proxy/__init__.py 2013-02-07 10:48:24.688511393 +0900
++++ slapos.core-0.34/slapos/proxy/__init__.py 2013-02-07 10:48:24.684511353 +0900
@@ -67,9 +67,11 @@
"""
(options, args) = self.parse_args()
@@ -75,11 +79,11 @@
class Config:
def setConfig(self, option_dict, configuration_file_path):
-Index: slapos.core-0.31.2/slapos/grid/svcbackend.py
+Index: slapos.core-0.34/slapos/grid/svcbackend.py
===================================================================
---- slapos.core-0.31.2.orig/slapos/grid/svcbackend.py 2012-09-25 21:55:43.000000000 +0900
-+++ slapos.core-0.31.2/slapos/grid/svcbackend.py 2012-10-03 12:27:00.933310593 +0900
-@@ -126,6 +126,8 @@
+--- slapos.core-0.34.orig/slapos/grid/svcbackend.py 2013-02-07 10:48:24.688511393 +0900
++++ slapos.core-0.34/slapos/grid/svcbackend.py 2013-02-07 10:48:24.684511353 +0900
+@@ -127,6 +127,8 @@
Typical usage:
* %prog CONFIGURATION_FILE [arguments passed to supervisor]
@@ -88,73 +92,174 @@
""".strip()
parser = OptionParser(usage=usage)
-@@ -136,13 +138,13 @@
- else:
- (argument_option_instance, argument_list) = \
- parser.parse_args(list(argument_tuple))
-- if len(argument_list) == 0:
+@@ -138,12 +140,12 @@
+ # No arguments given to entry point : we parse sys.argv.
+ (argument_option_instance, argument_list) = parser.parse_args()
+
+- if not argument_list:
- parser.error("Configuration file is obligatory. Consult documentation by "
- "calling with -h.")
- configuration_file = argument_list[0]
- if not os.path.exists(configuration_file):
-- parser.error("Could not read configuration file : %s" \
-- % configuration_file)
-+ if (len(argument_list) == 0 or not os.path.exists(argument_list[0])) and \
-+ os.path.exists('/etc/slapos/slapos-node-unofficial.cfg'):
-+ configuration_file = '/etc/slapos/slapos-node-unofficial.cfg'
-+ elif os.path.exists(argument_list[0]):
+- parser.error("Could not read configuration file : %s" % configuration_file)
++ if argument_list and os.path.exists(argument_list[0]):
+ configuration_file = argument_list.pop(0)
+ else:
-+ parser.error("Configuration file not found")
++ configuration_file = '/etc/slapos/slapos-node-unofficial.cfg'
++ if not os.path.exists(configuration_file):
++ parser.error("Could not read configuration file: %s" % configuration_file)
+
slapgrid_configuration = ConfigParser.SafeConfigParser()
slapgrid_configuration.read(configuration_file)
- # Merges the two dictionnaries
-@@ -155,7 +157,7 @@
- if not option_dict.get('supervisord_socket'):
- option_dict['supervisord_socket'] = \
- os.path.join(option_dict['instance_root'], 'supervisord.socket')
+@@ -156,7 +158,7 @@
+ # Supervisord socket
+ option_dict.setdefault('supervisord_socket',
+ os.path.join(option_dict['instance_root'], 'supervisord.socket'))
- return option_dict, argument_list[1:]
+ return option_dict, argument_list
def supervisorctl(*argument_tuple):
-Index: slapos.core-0.31.2/slapos/console.py
+Index: slapos.core-0.34/slapos/bang.py
===================================================================
---- slapos.core-0.31.2.orig/slapos/console.py 2012-09-25 21:55:43.000000000 +0900
-+++ slapos.core-0.31.2/slapos/console.py 2012-10-03 12:27:00.933310593 +0900
-@@ -62,10 +62,8 @@
- Check arguments
+--- slapos.core-0.34.orig/slapos/bang.py 2013-02-07 10:48:24.688511393 +0900
++++ slapos.core-0.34/slapos/bang.py 2013-02-07 10:48:24.684511353 +0900
+@@ -34,13 +34,14 @@
+ def main(*args):
+ parser = argparse.ArgumentParser()
+ parser.add_argument("-m", "--message", default='', help="Message for bang.")
+- parser.add_argument("configuration_file", nargs=1, type=argparse.FileType(),
++ parser.add_argument("configuration_file", nargs='?', type=argparse.FileType(),
++ default='/etc/slapos/slapos-node-unofficial.cfg',
+ help="SlapOS configuration file.")
+ if len(args) == 0:
+ argument = parser.parse_args()
+ else:
+ argument = parser.parse_args(list(args))
+- configuration_file = argument.configuration_file[0]
++ configuration_file = argument.configuration_file
+ message = argument.message
+ # Loads config (if config specified)
+ configuration = ConfigParser.SafeConfigParser()
+Index: slapos.core-0.34/slapos/client.py
+===================================================================
+--- slapos.core-0.34.orig/slapos/client.py 2013-02-07 10:48:24.688511393 +0900
++++ slapos.core-0.34/slapos/client.py 2013-02-07 10:48:24.684511353 +0900
+@@ -64,12 +64,15 @@
"""
(options, args) = self.parse_args()
-- if len(args) == 0:
+ if len(args) == 0:
- self.error("Incorrect number of arguments")
- elif not os.path.isfile(args[0]):
- self.error("%s: Not found or not a regular file." % args[0])
-+ if len(args) == 0 or not os.path.isfile(args[0]):
-+ args.insert(0, '/etc/slapos/slapos-client.cfg')
++ configuration_file_path = '/etc/slapos/slapos-client.cfg'
++ else:
++ configuration_file_path = args[0]
++
++ if not os.path.isfile(configuration_file_path):
++ self.error("%s: Not found or not a regular file." % configuration_file_path)
- return options, args
+- # Return options and only first element of args since there is only one.
+- return options, args[0]
++ # Return options and configuration file path
++ return options, configuration_file_path
-@@ -152,7 +150,11 @@
- """Ran when invoking slapos-request"""
- # Parse arguments
- usage = """usage: %s [options] CONFIGURATION_FILE SOFTWARE_INSTANCE INSTANCE_REFERENCE
--slapos-request allows you to request slapos instances.""" % sys.argv[0]
-+slapos-request allows you to request slapos instances.
+
+ def argToDict(element):
+@@ -86,6 +89,8 @@
+ """
+ parser = argparse.ArgumentParser()
+ parser.add_argument("configuration_file",
++ nargs='?',
++ default='/etc/slapos/slapos-client.cfg',
+ help="SlapOS configuration file.")
+ parser.add_argument("reference",
+ help="Your instance reference")
+@@ -124,13 +129,17 @@
+ setattr(self, option, value)
+
+ # Load configuration file
+- configuration_parser = ConfigParser.SafeConfigParser()
+ if configuration_file_path:
+ configuration_file_path = os.path.expanduser(configuration_file_path)
+- if not os.path.isfile(configuration_file_path):
+- raise OSError('Specified configuration file %s does not exist.'
+- ' Exiting.' % configuration_file_path)
+- configuration_parser.read(configuration_file_path)
++ else:
++ configuration_file_path = '/etc/slapos/slapos-client.cfg'
+
-+If CONFIGURATION_FILE is not given explicitly, then `/etc/slapos/slapos-client.cfg'
-+will be used.
-+""" % sys.argv[0]
- config = Config()
- options, arguments = RequestParser(usage=usage).check_args()
- config.setConfig(options, arguments[0])
-@@ -187,6 +189,9 @@
++ if not os.path.isfile(configuration_file_path):
++ raise OSError('Specified configuration file %s does not exist.'
++ ' Exiting.' % configuration_file_path)
++
++ configuration_parser = ConfigParser.SafeConfigParser()
++ configuration_parser.read(configuration_file_path)
+ # Merges the arguments and configuration
+ try:
+ configuration_dict = dict(configuration_parser.items('slapconsole'))
+@@ -249,6 +258,8 @@
+ # XXX-Cedric: move argument parsing to main entry point
+ parser = argparse.ArgumentParser()
+ parser.add_argument("configuration_file",
++ nargs='?',
++ default='/etc/slapos/slapos-client.cfg',
+ help="SlapOS configuration file")
+ parser.add_argument("software_url",
+ help="Your software url")
+@@ -266,6 +277,8 @@
+ # XXX-Cedric: move argument parsing to main entry point
+ parser = argparse.ArgumentParser()
+ parser.add_argument("configuration_file",
++ nargs='?',
++ default='/etc/slapos/slapos-client.cfg',
+ help="SlapOS configuration file.")
+ parser.add_argument("software_url",
+ help="Your software url")
+@@ -284,6 +297,9 @@
slapconsole allows you interact with slap API. You can play with the global
"slap" object and with the global "request" method.
-+If CONFIGURATION_FILE is not given explicitly, then `/etc/slapos/slapos-client.cfg'
-+will be used.
+++If CONFIGURATION_FILE is not given explicitly, it fallbacks on
++`/etc/slapos/slapos-client.cfg'.
+
examples :
>>> # Request instance
>>> request(kvm, "myuniquekvm")
+Index: slapos.core-0.34/slapos/entry.py
+===================================================================
+--- slapos.core-0.34.orig/slapos/entry.py 2013-02-07 10:48:24.688511393 +0900
++++ slapos.core-0.34/slapos/entry.py 2013-02-07 10:48:24.684511353 +0900
+@@ -49,11 +49,15 @@
+
+ GLOBAL_SLAPOS_CONFIGURATION = os.environ.get(
+ 'SLAPOS_CONFIGURATION',
+- '/etc/opt/slapos/slapos.cfg')
++ '/etc/slapos/slapos-node-unofficial.cfg')
++
+ USER_SLAPOS_CONFIGURATION = os.environ.get(
+ 'SLAPOS_CLIENT_CONFIGURATION',
+ os.environ.get('SLAPOS_CONFIGURATION', '~/.slapos/slapos.cfg'))
+
++if not os.path.exists(USER_SLAPOS_CONFIGURATION):
++ USER_SLAPOS_CONFIGURATION = GLOBAL_SLAPOS_CONFIGURATION
++
+ class EntryPointNotImplementedError(NotImplementedError):
+ def __init__(self, *args, **kw_args):
+ NotImplementedError.__init__(self, *args, **kw_args)
+Index: slapos.core-0.34/slapos/cache.py
+===================================================================
+--- slapos.core-0.34.orig/slapos/cache.py 2013-02-07 10:48:24.688511393 +0900
++++ slapos.core-0.34/slapos/cache.py 2013-02-07 10:49:08.560952011 +0900
+@@ -18,7 +18,10 @@
+
+ def cache_lookup():
+ parser = argparse.ArgumentParser()
+- parser.add_argument("configuration_file", help="SlapOS configuration file")
++ parser.add_argument(
++ "configuration_file",
++ help="SlapOS configuration file (by default: ~/.slapos/slapos.cfg "
++ "then /etc/slapos/slapos-client.cfg)")
+ parser.add_argument("software_url", help="Your software url or MD5 hash")
+ args = parser.parse_args()
+
Modified: packages/slapos.core/trunk/debian/pydist-overrides
===================================================================
--- packages/slapos.core/trunk/debian/pydist-overrides 2013-02-04 13:15:18 UTC (rev 9409)
+++ packages/slapos.core/trunk/debian/pydist-overrides 2013-02-07 03:00:21 UTC (rev 9410)
@@ -1,2 +1,5 @@
setuptools python-pkg-resources, python-setuptools
xml_marshaller python-xmlmarshaller
+zc.buildout
+pyflakes
+unittest2
Modified: packages/slapos.core/trunk/debian/rules
===================================================================
--- packages/slapos.core/trunk/debian/rules 2013-02-04 13:15:18 UTC (rev 9409)
+++ packages/slapos.core/trunk/debian/rules 2013-02-07 03:00:21 UTC (rev 9410)
@@ -6,6 +6,9 @@
override_dh_install:
dh_install --list-missing
+override_dh_compress:
+ dh_compress -X.cfg
+
# Generate the upstream tarball from upstream Git (adapted from
# http://wiki.debian.org/SandroTosi/Svn_get-orig-source for Git)
PACKAGE := $(shell dpkg-parsechangelog | \
Modified: packages/slapos.core/trunk/debian/slapos-client.install
===================================================================
--- packages/slapos.core/trunk/debian/slapos-client.install 2013-02-04 13:15:18 UTC (rev 9409)
+++ packages/slapos.core/trunk/debian/slapos-client.install 2013-02-07 03:00:21 UTC (rev 9410)
@@ -1,9 +1,12 @@
usr/lib/python2.*/dist-packages/slapos.core*.egg-info/
-usr/lib/python2.*/dist-packages/slapos/console.py
+usr/lib/python2.*/dist-packages/slapos/entry.py
+usr/lib/python2.*/dist-packages/slapos/client.py
+usr/lib/python2.*/dist-packages/slapos/cache.py
usr/lib/python2.*/dist-packages/slapos/slapos.xsd
usr/lib/python2.*/dist-packages/slapos/slap/
+usr/lib/python2.*/dist-packages/slapos/tests/__init__.py
usr/lib/python2.*/dist-packages/slapos/tests/slap.py
usr/lib/python2.*/dist-packages/slapos/tests/interface.py
usr/lib/python2.*/dist-packages/slapos.core-*-nspkg.pth
-usr/bin/slapos-request
usr/bin/slapconsole
+usr/bin/slapos
Modified: packages/slapos.core/trunk/debian/slapos-client.postinst
===================================================================
--- packages/slapos.core/trunk/debian/slapos-client.postinst 2013-02-04 13:15:18 UTC (rev 9409)
+++ packages/slapos.core/trunk/debian/slapos-client.postinst 2013-02-07 03:00:21 UTC (rev 9410)
@@ -5,14 +5,16 @@
. /usr/share/debconf/confmodule
-CONFIG_FILE=/etc/slapos/slapos-client.cfg
-if [ ! -f $CONFIG_FILE ]; then
- echo "# Never edit this file by hand as it has been automatically generated by
+# First, create a temporary configuration file before letting ucf handles the
+# changes between the existing file (if any) and the new version
+TEMP_CONFIG_FILE=`mktemp --tmpdir=/tmp slapos-client.cfg.XXXXXX.cfg`
+chmod 0644 $TEMP_CONFIG_FILE
+
+echo "# Never edit this file by hand as it has been automatically generated by
# debconf. You can change the settings at any time by running:
-# ``dpkg-reconfigure -pmedium slapos-client''" > $CONFIG_FILE
+# ``dpkg-reconfigure -pmedium slapos-client''" > $TEMP_CONFIG_FILE
- cat < /usr/share/doc/slapos-client/examples/slapos-client.cfg >> $CONFIG_FILE
-fi
+cat < /usr/share/doc/slapos-client/examples/slapos-client.cfg >> $TEMP_CONFIG_FILE
# Synchronize master_url, key_file and cert_file with slapos-client.cfg
SLAPOS_NODE_CONFIG_FILE=/etc/slapos/slapos-node-unofficial.cfg
@@ -25,15 +27,20 @@
WITH_HTTPS=$(echo "$MASTER_URL" | grep -q "^https://" && echo true || echo false)
sed -e "s#^\s*master_url\s*=.*#master_url = $MASTER_URL#" \
- -i $CONFIG_FILE $SLAPOS_NODE_CONFIG_FILE
+ -i $TEMP_CONFIG_FILE $SLAPOS_NODE_CONFIG_FILE
# Handle HTTPS URLs by just commenting/uncommenting the relevant lines
if $WITH_HTTPS; then
sed -i 's/^\s*#\+\s*\(key_file\|cert_file\)/\1/' \
- $CONFIG_FILE $SLAPOS_NODE_CONFIG_FILE
+ $TEMP_CONFIG_FILE $SLAPOS_NODE_CONFIG_FILE
else
sed -i 's/^\s*[^#]*\s*\(key_file\|cert_file\)/#\1/' \
- $CONFIG_FILE $SLAPOS_NODE_CONFIG_FILE
+ $TEMP_CONFIG_FILE $SLAPOS_NODE_CONFIG_FILE
fi
+ucf --three-way --debconf-ok $TEMP_CONFIG_FILE /etc/slapos/slapos-client.cfg
+db_go
+
+rm -f $TEMP_CONFIG_FILE
+
exit 0
Modified: packages/slapos.core/trunk/debian/slapos-client.postrm
===================================================================
--- packages/slapos.core/trunk/debian/slapos-client.postrm 2013-02-04 13:15:18 UTC (rev 9409)
+++ packages/slapos.core/trunk/debian/slapos-client.postrm 2013-02-07 03:00:21 UTC (rev 9410)
@@ -5,6 +5,7 @@
case "$1" in
purge)
+ ucf --purge /etc/slapos/slapos-client.cfg || true
rm -rf /etc/slapos/
;;
esac
Modified: packages/slapos.core/trunk/debian/slapos-node-unofficial.docs
===================================================================
--- packages/slapos.core/trunk/debian/slapos-node-unofficial.docs 2013-02-04 13:15:18 UTC (rev 9409)
+++ packages/slapos.core/trunk/debian/slapos-node-unofficial.docs 2013-02-07 03:00:21 UTC (rev 9410)
@@ -1,2 +1,3 @@
slapos/README.format.txt
slapos/README.grid.txt
+slapos/README.proxy.txt
Modified: packages/slapos.core/trunk/debian/slapos-node-unofficial.install
===================================================================
--- packages/slapos.core/trunk/debian/slapos-node-unofficial.install 2013-02-04 13:15:18 UTC (rev 9409)
+++ packages/slapos.core/trunk/debian/slapos-node-unofficial.install 2013-02-07 03:00:21 UTC (rev 9410)
@@ -1,11 +1,16 @@
+usr/lib/python2.*/dist-packages/slapos/register
usr/lib/python2.*/dist-packages/slapos/proxy
usr/lib/python2.*/dist-packages/slapos/bang.py
+usr/lib/python2.*/dist-packages/slapos/tests/entry.py
usr/lib/python2.*/dist-packages/slapos/tests/slapgrid.py
usr/lib/python2.*/dist-packages/slapos/tests/mock
+usr/lib/python2.*/dist-packages/slapos/tests/pyflakes
usr/lib/python2.*/dist-packages/slapos/tests/slapobject.py
+usr/lib/python2.*/dist-packages/slapos/tests/slapproxy.py
usr/lib/python2.*/dist-packages/slapos/tests/slapformat.py
usr/lib/python2.*/dist-packages/slapos/format.py
usr/lib/python2.*/dist-packages/slapos/grid
+usr/bin/slapos-watchdog usr/sbin
usr/bin/slapformat usr/sbin
usr/bin/slapgrid-supervisorctl usr/sbin
usr/bin/slapgrid-supervisord usr/sbin
Modified: packages/slapos.core/trunk/debian/slapos-node-unofficial.postinst
===================================================================
--- packages/slapos.core/trunk/debian/slapos-node-unofficial.postinst 2013-02-04 13:15:18 UTC (rev 9409)
+++ packages/slapos.core/trunk/debian/slapos-node-unofficial.postinst 2013-02-07 03:00:21 UTC (rev 9410)
@@ -5,15 +5,17 @@
. /usr/share/debconf/confmodule
-CONFIG_FILE=/etc/slapos/slapos-node-unofficial.cfg
-if [ ! -f $CONFIG_FILE ]; then
- echo "# Never edit this file by hand as it has been automatically generated by
+# First, create a temporary configuration file before letting ucf handles the
+# changes between the existing file (if any) and the new version
+TEMP_CONFIG_FILE=`mktemp --tmpdir=/tmp slapos-node-unofficial.XXXXXX.cfg`
+chmod 0644 $TEMP_CONFIG_FILE
+
+echo "# Never edit this file by hand as it has been automatically generated by
# debconf. You can change the settings at any time by running:
-# ``dpkg-reconfigure -pmedium slapos-node-unofficial''" > $CONFIG_FILE
+# ``dpkg-reconfigure -pmedium slapos-node-unofficial''" > $TEMP_CONFIG_FILE
- cat < /usr/share/doc/slapos-node-unofficial/examples/slapos-node-unofficial.cfg \
- >> $CONFIG_FILE
-fi
+cat < /usr/share/doc/slapos-node-unofficial/examples/slapos-node-unofficial.cfg \
+ >> $TEMP_CONFIG_FILE
# Synchronize master_url, key_file and cert_file with slapos-client.cfg
SLAPOS_CLIENT_CONFIG_FILE=/etc/slapos/slapos-client.cfg
@@ -30,15 +32,15 @@
sed -e "s#^\s*master_url\s*=.*#master_url = $MASTER_URL#" \
-e "s#^\s*computer_id\s*=.*#computer_id = $COMPUTER_ID#" \
- -i $CONFIG_FILE $SLAPOS_CLIENT_CONFIG_FILE
+ -i $TEMP_CONFIG_FILE $SLAPOS_CLIENT_CONFIG_FILE
# Handle HTTPS URLs by just commenting/uncommenting the relevant lines
if $WITH_HTTPS; then
sed -i 's/^\s*#\+\s*\(key_file\|cert_file\|certificate_repository_path\)/\1/' \
- $CONFIG_FILE $SLAPOS_CLIENT_CONFIG_FILE
+ $TEMP_CONFIG_FILE $SLAPOS_CLIENT_CONFIG_FILE
else
sed -i 's/^\s*[^#]*\s*\(key_file\|cert_file\|certificate_repository_path\)/#\1/' \
- $CONFIG_FILE $SLAPOS_CLIENT_CONFIG_FILE
+ $TEMP_CONFIG_FILE $SLAPOS_CLIENT_CONFIG_FILE
fi
db_get slapos-node-unofficial/software_root
@@ -53,6 +55,13 @@
sed -e "s#^\s*software_root\s*=.*#software_root = $SOFTWARE_ROOT#" \
-e "s#^\s*partition_amount\s*=.*#partition_amount = $PARTITION_AMOUNT#" \
-e "s#^\s*ipv4_local_network\s*=.*#ipv4_local_network = $IPV4_LOCAL_NETWORK#" \
- -i $CONFIG_FILE
+ -i $TEMP_CONFIG_FILE
+ucf --three-way --debconf-ok $TEMP_CONFIG_FILE \
+ /etc/slapos/slapos-node-unofficial.cfg
+
+db_go
+
+rm -f $TEMP_CONFIG_FILE
+
exit 0
Modified: packages/slapos.core/trunk/debian/slapos-node-unofficial.postrm
===================================================================
--- packages/slapos.core/trunk/debian/slapos-node-unofficial.postrm 2013-02-04 13:15:18 UTC (rev 9409)
+++ packages/slapos.core/trunk/debian/slapos-node-unofficial.postrm 2013-02-07 03:00:21 UTC (rev 9410)
@@ -5,11 +5,12 @@
case "$1" in
purge)
+ ucf --purge /etc/slapos/slapos-node-unofficial.cfg || true
db_get slapos-node-unofficial/software_root
SOFTWARE_ROOT="$RET"
- rm -rf /var/log/slapos/ /var/lib/slapos/ /var/cache/slapos/certificates/ \
- "$SOFTWARE_ROOT"
+ rm -rf /etc/slapos/ /var/log/slapos/ /var/lib/slapos/ \
+ /var/cache/slapos/certificates/ "$SOFTWARE_ROOT"
;;
esac
More information about the Python-apps-commits
mailing list