Hello community,
here is the log from the commit of package ceph-deploy for openSUSE:Factory checked in at 2016-09-07 11:46:39
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ceph-deploy (Old)
and /work/SRC/openSUSE:Factory/.ceph-deploy.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ceph-deploy"
Changes:
--------
--- /work/SRC/openSUSE:Factory/ceph-deploy/ceph-deploy.changes 2016-04-28 17:00:06.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.ceph-deploy.new/ceph-deploy.changes 2016-09-07 11:46:41.000000000 +0200
@@ -1,0 +2,57 @@
+Tue Aug 9 14:45:55 UTC 2016 - osynge@suse.com
+
+- Updated to 1.5.34
+ + Do not call partx/partprobe when zapping disks
+ + No longer allow using ext4
+ + Default to systemd for SUSE
+ + Remove usage of rcceph (for SUSE)
+ + No longer depend on automatic ``ceph-create-keys``, use the monitors to
+ fetch keys.
+- Protect against two rgw using the same port.
+ + bnc#980708
+
+-------------------------------------------------------------------
+Tue May 24 11:38:44 UTC 2016 - osynge@suse.com
+
+- gatherkeys subcommand to handle long hostnames.
+ + bnc#981304
+
+-------------------------------------------------------------------
+Thu May 19 18:03:43 UTC 2016 - osynge@suse.com
+
+- rgw help now works on SLE12 as well as LEAP.
+ + bnc#980704
+
+-------------------------------------------------------------------
+Wed May 18 15:15:41 UTC 2016 - osynge@suse.com
+
+- Revert previous fix to bnc#980273 and apply better fix.
+
+-------------------------------------------------------------------
+Wed May 18 11:52:21 UTC 2016 - osynge@suse.com
+
+- loosen restrictions on rgw names
+
+-------------------------------------------------------------------
+Wed May 18 10:13:20 UTC 2016 - osynge@suse.com
+
+- ceph-deploy purge no longer aborts if one package is not installed
+ + bnc#980273
+- Install RadosGW with non valid chanacters trapped early
+ + bnc#976395
+
+-------------------------------------------------------------------
+Fri May 13 16:23:17 UTC 2016 - osynge@suse.com
+
+- Added rgw port options
+ + bnc#979872
+- Add warning if deploying a rgw twice
+ + bnc#970526
+
+-------------------------------------------------------------------
+Wed May 4 12:25:47 UTC 2016 - osynge@suse.com
+
+- Added rgw delete to online help.
+ + bnc#978432
+
+-------------------------------------------------------------------
Old:
----
ceph-deploy-1.5.32+git.1460619432.b539689.tar.xz
New:
----
ceph-deploy-1.5.34+git.1470736983.963ba71.tar.xz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ceph-deploy.spec ++++++
--- /var/tmp/diff_new_pack.9OM1KQ/_old 2016-09-07 11:46:42.000000000 +0200
+++ /var/tmp/diff_new_pack.9OM1KQ/_new 2016-09-07 11:46:42.000000000 +0200
@@ -22,7 +22,7 @@
%endif
Name: ceph-deploy
-Version: 1.5.32+git.1460619432.b539689
+Version: 1.5.34+git.1470736983.963ba71
Release: 0
Summary: Admin and deploy tool for Ceph
License: MIT
++++++ _service ++++++
--- /var/tmp/diff_new_pack.9OM1KQ/_old 2016-09-07 11:46:42.000000000 +0200
+++ /var/tmp/diff_new_pack.9OM1KQ/_new 2016-09-07 11:46:42.000000000 +0200
@@ -1,8 +1,8 @@
<services>
<service name="tar_scm" mode="disabled">
- <param name="versionformat">1.5.32+git.%ct.%h</param>
+ <param name="versionformat">1.5.34+git.%ct.%h</param>
<param name="url">https://github.com/SUSE/ceph-deploy.git</param>
- <param name="revision">distro/suse/v1.5.32</param>
+ <param name="revision">distro/suse/v1.5.34</param>
<param name="filename">ceph-deploy</param>
<param name="scm">git</param>
</service>
++++++ ceph-deploy-1.5.32+git.1460619432.b539689.tar.xz -> ceph-deploy-1.5.34+git.1470736983.963ba71.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ceph-deploy-1.5.32+git.1460619432.b539689/ceph-deploy.spec new/ceph-deploy-1.5.34+git.1470736983.963ba71/ceph-deploy.spec
--- old/ceph-deploy-1.5.32+git.1460619432.b539689/ceph-deploy.spec 2016-04-14 09:39:11.000000000 +0200
+++ new/ceph-deploy-1.5.34+git.1470736983.963ba71/ceph-deploy.spec 2016-08-09 15:22:14.000000000 +0200
@@ -11,7 +11,7 @@
# common
#################################################################################
Name: ceph-deploy
-Version: 1.5.32
+Version: 1.5.34
Release: 0
Summary: Admin and deploy tool for Ceph
License: MIT
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ceph-deploy-1.5.32+git.1460619432.b539689/ceph_deploy/__init__.py new/ceph-deploy-1.5.34+git.1470736983.963ba71/ceph_deploy/__init__.py
--- old/ceph-deploy-1.5.32+git.1460619432.b539689/ceph_deploy/__init__.py 2016-04-14 09:39:11.000000000 +0200
+++ new/ceph-deploy-1.5.34+git.1470736983.963ba71/ceph_deploy/__init__.py 2016-08-09 15:22:14.000000000 +0200
@@ -1,3 +1,3 @@
-__version__ = '1.5.32'
+__version__ = '1.5.34'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ceph-deploy-1.5.32+git.1460619432.b539689/ceph_deploy/gatherkeys.py new/ceph-deploy-1.5.34+git.1470736983.963ba71/ceph_deploy/gatherkeys.py
--- old/ceph-deploy-1.5.32+git.1460619432.b539689/ceph_deploy/gatherkeys.py 2016-04-14 09:39:11.000000000 +0200
+++ new/ceph-deploy-1.5.34+git.1470736983.963ba71/ceph_deploy/gatherkeys.py 2016-08-09 15:22:14.000000000 +0200
@@ -119,7 +119,7 @@
arguments
)
if code != 0:
- rlogger.error('"ceph auth get-or-create for keytype %s returned %s' % (keytype, code))
+ rlogger.error('"ceph auth get-or-create for keytype %s returned %s', keytype, code)
for line in err:
rlogger.debug(line)
return False
@@ -136,18 +136,19 @@
Connect to mon and gather keys if mon is in quorum.
"""
distro = hosts.get(host, username=args.username)
- dir_keytype_mon = ceph_deploy.util.paths.mon.path(args.cluster, host)
+ remote_hostname = distro.conn.remote_module.shortname()
+ dir_keytype_mon = ceph_deploy.util.paths.mon.path(args.cluster, remote_hostname)
path_keytype_mon = "%s/keyring" % (dir_keytype_mon)
mon_key = distro.conn.remote_module.get_file(path_keytype_mon)
if mon_key is None:
- LOG.warning("No mon key found. Is '%s' a mon node" % (host))
+ LOG.warning("No mon key found in host: %s", host)
return False
mon_name_local = keytype_path_to(args, "mon")
mon_path_local = os.path.join(dest_dir, mon_name_local)
with file(mon_path_local, 'w') as f:
f.write(mon_key)
rlogger = logging.getLogger(host)
- path_asok = ceph_deploy.util.paths.mon.asok(args.cluster, host)
+ path_asok = ceph_deploy.util.paths.mon.asok(args.cluster, remote_hostname)
out, err, code = remoto.process.check(
distro.conn,
[
@@ -161,44 +162,46 @@
]
)
if code != 0:
- rlogger.error('"ceph mon_status %s" returned %s' % (host, code))
+ rlogger.error('"ceph mon_status %s" returned %s', host, code)
for line in err:
rlogger.debug(line)
return False
try:
mon_status = json.loads("".join(out))
except ValueError:
- rlogger.error('"ceph mon_status %s" output was not json' % (host))
+ rlogger.error('"ceph mon_status %s" output was not json', host)
+ for line in out:
+ rlogger.error(line)
return False
mon_number = None
mon_map = mon_status.get('monmap')
if mon_map is None:
- rlogger.error("could not find mon map for mons on '%s'" % (host))
+ rlogger.error("could not find mon map for mons on '%s'", host)
return False
mon_quorum = mon_status.get('quorum')
if mon_quorum is None:
- rlogger.error("could not find quorum for mons on '%s'" % (host))
+ rlogger.error("could not find quorum for mons on '%s'" , host)
return False
mon_map_mons = mon_map.get('mons')
if mon_map_mons is None:
- rlogger.error("could not find mons in monmap on '%s'" % (host))
+ rlogger.error("could not find mons in monmap on '%s'", host)
return False
for mon in mon_map_mons:
- if mon.get('name') == host:
+ if mon.get('name') == remote_hostname:
mon_number = mon.get('rank')
break
if mon_number is None:
- rlogger.error("could not find '%s' in monmap" % (host))
+ rlogger.error("could not find '%s' in monmap", remote_hostname)
return False
if not mon_number in mon_quorum:
- rlogger.error("Not yet quorum for '%s'" % (host))
+ rlogger.error("Not yet quorum for '%s'", host)
return False
- got_all_keys = True
for keytype in ["admin", "mds", "osd", "rgw"]:
- rc = gatherkeys_missing(args, distro, rlogger, path_keytype_mon, keytype, dest_dir)
- if not rc:
- got_all_keys = False
- return got_all_keys
+ if not gatherkeys_missing(args, distro, rlogger, path_keytype_mon, keytype, dest_dir):
+ # We will return failure if we fail to gather any key
+ rlogger.error("Failed to return '%s' key from host ", keytype, host)
+ return False
+ return True
def gatherkeys(args):
@@ -211,14 +214,14 @@
try:
try:
tmpd = tempfile.mkdtemp()
- LOG.info("Storing keys in temp directory %s" %(tmpd))
+ LOG.info("Storing keys in temp directory %s", tmpd)
sucess = False
for host in args.mon:
sucess = gatherkeys_with_mon(args, host, tmpd)
if sucess:
break
if not sucess:
- LOG.error("Failed to connect to host:%s" % (', '.join(args.mon)))
+ LOG.error("Failed to connect to host:%s" ,', '.join(args.mon))
raise RuntimeError('Failed to connect any mon')
had_error = False
date_string = time.strftime("%Y%m%d%H%M%S")
@@ -226,7 +229,7 @@
filename = keytype_path_to(args, keytype)
tmp_path = os.path.join(tmpd, filename)
if not os.path.exists(tmp_path):
- LOG.error("No key retrived for '%s'" % (keytype))
+ LOG.error("No key retrived for '%s'" , keytype)
had_error = True
continue
if not os.path.exists(filename):
@@ -234,10 +237,10 @@
shutil.move(tmp_path, filename)
continue
if _keyring_equivalent(tmp_path, filename):
- LOG.info("keyring '%s' already exists" % (filename))
+ LOG.info("keyring '%s' already exists" , filename)
continue
backup_keyring = "%s-%s" % (filename, date_string)
- LOG.info("Replacing '%s' and backing up old key as '%s'" % (filename, date_string))
+ LOG.info("Replacing '%s' and backing up old key as '%s'", filename, backup_keyring)
shutil.copy(filename, backup_keyring)
shutil.move(tmp_path, filename)
if had_error:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ceph-deploy-1.5.32+git.1460619432.b539689/ceph_deploy/install.py new/ceph-deploy-1.5.34+git.1470736983.963ba71/ceph_deploy/install.py
--- old/ceph-deploy-1.5.32+git.1460619432.b539689/ceph_deploy/install.py 2016-04-14 09:39:11.000000000 +0200
+++ new/ceph-deploy-1.5.34+git.1470736983.963ba71/ceph_deploy/install.py 2016-08-09 15:22:14.000000000 +0200
@@ -17,7 +17,7 @@
not well suited for.
"""
if args.release is None:
- args.release = 'infernalis'
+ args.release = 'jewel'
args.default_release = True
# XXX This whole dance is because --stable is getting deprecated
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ceph-deploy-1.5.32+git.1460619432.b539689/ceph_deploy/osd.py new/ceph-deploy-1.5.34+git.1470736983.963ba71/ceph_deploy/osd.py
--- old/ceph-deploy-1.5.32+git.1460619432.b539689/ceph_deploy/osd.py 2016-04-14 09:39:11.000000000 +0200
+++ new/ceph-deploy-1.5.34+git.1470736983.963ba71/ceph_deploy/osd.py 2016-08-09 15:22:14.000000000 +0200
@@ -372,7 +372,7 @@
LOG.debug('activating host %s disk %s', hostname, disk)
LOG.debug('will use init type: %s', distro.init)
-
+
ceph_disk_executable = system.executable_path(distro.conn, 'ceph-disk')
remoto.process.run(
distro.conn,
@@ -428,34 +428,6 @@
],
)
- # once all is done, call partprobe (or partx)
- # On RHEL and CentOS distros, calling partprobe forces a reboot of the
- # server. Since we are not resizing partitons we rely on calling
- # partx
- if distro.normalized_name.startswith(('centos', 'red')):
- LOG.info('calling partx on zapped device %s', disk)
- LOG.info('re-reading known partitions will display errors')
- partx_executable = system.executable_path(distro.conn, 'partx')
- remoto.process.run(
- distro.conn,
- [
- partx_executable,
- '-a',
- disk,
- ],
- )
-
- else:
- LOG.debug('Calling partprobe on zapped device %s', disk)
- partprobe_executable = system.executable_path(distro.conn, 'partprobe')
- remoto.process.run(
- distro.conn,
- [
- partprobe_executable,
- disk,
- ],
- )
-
distro.conn.exit()
@@ -708,11 +680,10 @@
'--fs-type',
metavar='FS_TYPE',
choices=['xfs',
- 'ext4',
'btrfs'
],
default='xfs',
- help='filesystem to use to format DISK (xfs, btrfs, or ext4)',
+ help='filesystem to use to format DISK (xfs, btrfs)',
)
osd_create.add_argument(
'--dmcrypt',
@@ -751,11 +722,10 @@
'--fs-type',
metavar='FS_TYPE',
choices=['xfs',
- 'ext4',
'btrfs'
],
default='xfs',
- help='filesystem to use to format DISK (xfs, btrfs, or ext4)',
+ help='filesystem to use to format DISK (xfs, btrfs)',
)
osd_prepare.add_argument(
'--dmcrypt',
@@ -841,11 +811,10 @@
'--fs-type',
metavar='FS_TYPE',
choices=['xfs',
- 'ext4',
'btrfs'
],
default='xfs',
- help='filesystem to use to format DISK (xfs, btrfs, or ext4)',
+ help='filesystem to use to format DISK (xfs, btrfs)',
)
disk_prepare.add_argument(
'--dmcrypt',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ceph-deploy-1.5.32+git.1460619432.b539689/ceph_deploy/rgw.py new/ceph-deploy-1.5.34+git.1470736983.963ba71/ceph_deploy/rgw.py
--- old/ceph-deploy-1.5.32+git.1460619432.b539689/ceph_deploy/rgw.py 2016-04-14 09:39:11.000000000 +0200
+++ new/ceph-deploy-1.5.34+git.1470736983.963ba71/ceph_deploy/rgw.py 2016-08-09 15:22:14.000000000 +0200
@@ -9,6 +9,7 @@
from ceph_deploy.util import system
from ceph_deploy.lib import remoto
from ceph_deploy.cliutil import priority
+from ceph_deploy import validate
LOG = logging.getLogger(__name__)
@@ -137,6 +138,39 @@
)
+def rgw_duplicate_port_check(cfg):
+ all_sections = cfg.sections()
+ host_port_mapping = {}
+ for section in all_sections:
+ if cfg.has_option(section, 'host') is False:
+ continue
+ if cfg.has_option(section, 'rgw_frontends') is False:
+ continue
+ host = cfg.get(section, 'host')
+ rgw_frontends = cfg.get(section, 'rgw_frontends')
+ port_num = None
+ for option in rgw_frontends.split(' '):
+ options_split = option.split('=')
+ if len(options_split) < 2:
+ continue
+ if options_split[0].strip() == 'port':
+ port_str = options_split[1].strip()
+ try:
+ port_num = int(port_str)
+ except:
+ continue
+ if port_num is None:
+ continue
+ old_num = host_port_mapping.get(host)
+ if old_num == None:
+ host_port_mapping[host] = port_num
+ continue
+ if old_num == port_num:
+ LOG.warning('Duplicate services for port %s on host %s.' % (port_num, host))
+ return True
+ return False
+
+
def rgw_create(args):
cfg = conf.ceph.load(args)
LOG.debug(
@@ -152,32 +186,55 @@
# Update the config file
changed_cfg = False
- for hostname, name in args.rgw:
+ for hostname, name, port in args.rgw:
if not name.startswith('rgw.'):
msg = "rgw name '%s' does not start with 'rgw.'" % (name)
LOG.error(msg)
raise RuntimeError(msg)
enitity = 'client.{name}'.format(name=name)
- port = 7480
if cfg.has_section(enitity) is False:
cfg.add_section(enitity)
changed_cfg = True
+ else:
+ # We have existing confg for the rgw
+ LOG.warning("existing configuration for rgw %s:%s" % (hostname, name))
if cfg.has_option(enitity,'host') is False:
cfg.set(enitity, 'host', hostname)
changed_cfg = True
+ else:
+ existing_value = cfg.get(enitity, 'host')
+ if existing_value != hostname:
+ msg = "exisiting rgw '%s:%s' has a different hostname" % (hostname, name)
+ LOG.error(msg)
+ raise RuntimeError(msg)
if cfg.has_option(enitity,'rgw_dns_name') is False:
- # TODO this should be customizable
- value = "%s:%s" % (hostname,port)
cfg.set(enitity, 'rgw_dns_name', hostname)
changed_cfg = True
+ else:
+ existing_value = cfg.get(enitity, 'rgw_dns_name')
+ if existing_value != hostname:
+ msg = "exisiting rgw '%s:%s' has a different rgw_dns_name" % (hostname, name)
+ LOG.error(msg)
+ raise RuntimeError(msg)
+ rgw_frontends_value = "civetweb port=%s" % (port)
if cfg.has_option(enitity,'rgw frontends') is False:
# TODO this should be customizable
- cfg.set(enitity, 'rgw frontends', "civetweb port=%s" % (port))
+ cfg.set(enitity, 'rgw frontends', rgw_frontends_value)
changed_cfg = True
+ else:
+ existing_value = cfg.get(enitity, 'rgw frontends')
+ if existing_value != rgw_frontends_value:
+ msg = "exisiting rgw '%s:%s' has a different 'rgw frontends'" % (hostname, name)
+ LOG.error(msg)
+ raise RuntimeError(msg)
# If config file is changed save changes locally
if changed_cfg is True:
cfg_path = args.ceph_conf or '{cluster}.conf'.format(cluster=args.cluster)
+ if rgw_duplicate_port_check(cfg):
+ msg = "Refusing to modify config file '%s' as it would have duplicate a port" % (cfg_path)
+ LOG.error(msg)
+ raise RuntimeError(msg)
if args.overwrite_conf is False:
msg = "The local config file '%s' exists with content that must be changed; use --overwrite-conf to update" % (cfg_path)
LOG.error(msg)
@@ -185,7 +242,7 @@
with open(cfg_path, 'wb') as configfile:
cfg.write(configfile)
- for hostname, name in args.rgw:
+ for hostname, name, port in args.rgw:
try:
distro = hosts.get(hostname, username=args.username)
rlogger = distro.conn.logger
@@ -220,9 +277,9 @@
distro.conn.exit()
LOG.info(
('The Ceph Object Gateway (RGW) is now running on host %s and '
- 'default port %s'),
+ 'port %s'),
hostname,
- '7480'
+ port
)
except RuntimeError as e:
LOG.error(e)
@@ -301,9 +358,8 @@
# Check if config needs to be changed
changed_cfg = False
- for hostname, name in args.rgw:
+ for hostname, name, port in args.rgw:
enitity = 'client.{name}'.format(name=name)
- port = 7480
if cfg.has_section(enitity) is True:
cfg.remove_section(enitity)
changed_cfg = True
@@ -322,7 +378,7 @@
cluster=args.cluster
)
- for hostname, name in args.rgw:
+ for hostname, name, port in args.rgw:
try:
distro = hosts.get(hostname, username=args.username)
rlogger = distro.conn.logger
@@ -363,7 +419,7 @@
with open(cfg_path, 'wb') as configfile:
cfg.write(configfile)
# now distribute
- for hostname, name in args.rgw:
+ for hostname, name, port in args.rgw:
try:
distro = hosts.get(hostname, username=args.username)
rlogger = distro.conn.logger
@@ -402,9 +458,14 @@
def colon_separated(s):
host = s
name = 'rgw.' + s
- if s.count(':') == 1:
+ port = '7480'
+ delimiter_count = s.count(':')
+ if delimiter_count == 1:
(host, name) = s.split(':')
- return (host, name)
+ if delimiter_count == 2:
+ (host, name, port) = s.split(':')
+ name = validate.alphanumericdot(name)
+ return (host, name, port)
@priority(30)
@@ -412,23 +473,32 @@
"""
Ceph RGW daemon management
"""
- parser.add_argument(
- 'subcommand',
- metavar='SUBCOMMAND',
- choices=[
- 'list',
- 'create',
- 'delete',
- ],
- help='list, create',
+ rgw_parser = parser.add_subparsers(dest='subcommand')
+ rgw_create = rgw_parser.add_parser(
+ 'create',
+ help='Create a rgw instance'
)
- parser.add_argument(
+ rgw_create.add_argument(
+ 'rgw',
+ metavar='HOST[:NAME][:PORT]',
+ nargs='+',
+ type=colon_separated,
+ help='host (and optionally the daemon name) to deploy on.',
+ )
+ rgw_delete = rgw_parser.add_parser(
+ 'delete',
+ help='Create a rgw instance'
+ )
+ rgw_delete.add_argument(
'rgw',
metavar='HOST[:NAME]',
- nargs='*',
+ nargs='+',
type=colon_separated,
- help='host (and optionally the daemon name) to deploy on. \
- NAME is automatically prefixed with \'rgw.\'',
+ help='host (and optionally the daemon name) to deploy on.',
+ )
+ rgw_list = rgw_parser.add_parser(
+ 'list',
+ help='list all rgw instances in local config'
)
parser.set_defaults(
func=rgw,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ceph-deploy-1.5.32+git.1460619432.b539689/ceph_deploy/tests/parser/test_disk.py new/ceph-deploy-1.5.34+git.1470736983.963ba71/ceph_deploy/tests/parser/test_disk.py
--- old/ceph-deploy-1.5.32+git.1460619432.b539689/ceph_deploy/tests/parser/test_disk.py 2016-04-14 09:39:11.000000000 +0200
+++ new/ceph-deploy-1.5.34+git.1470736983.963ba71/ceph_deploy/tests/parser/test_disk.py 2016-08-09 15:22:14.000000000 +0200
@@ -69,9 +69,9 @@
args = self.parser.parse_args('disk prepare host1:sdb'.split())
assert args.fs_type == "xfs"
- def test_disk_prepare_fstype_ext4(self):
- args = self.parser.parse_args('disk prepare --fs-type ext4 host1:sdb'.split())
- assert args.fs_type == "ext4"
+ def test_disk_prepare_fstype_btrfs(self):
+ args = self.parser.parse_args('disk prepare --fs-type btrfs host1:sdb'.split())
+ assert args.fs_type == "btrfs"
def test_disk_prepare_fstype_invalid(self, capsys):
with pytest.raises(SystemExit):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ceph-deploy-1.5.32+git.1460619432.b539689/ceph_deploy/tests/parser/test_osd.py new/ceph-deploy-1.5.34+git.1470736983.963ba71/ceph_deploy/tests/parser/test_osd.py
--- old/ceph-deploy-1.5.32+git.1460619432.b539689/ceph_deploy/tests/parser/test_osd.py 2016-04-14 09:39:11.000000000 +0200
+++ new/ceph-deploy-1.5.34+git.1470736983.963ba71/ceph_deploy/tests/parser/test_osd.py 2016-08-09 15:22:14.000000000 +0200
@@ -86,9 +86,9 @@
args = self.parser.parse_args('osd create host1:sdb'.split())
assert args.fs_type == "xfs"
- def test_osd_create_fstype_ext4(self):
- args = self.parser.parse_args('osd create --fs-type ext4 host1:sdb'.split())
- assert args.fs_type == "ext4"
+ def test_osd_create_fstype_btrfs(self):
+ args = self.parser.parse_args('osd create --fs-type btrfs host1:sdb'.split())
+ assert args.fs_type == "btrfs"
def test_osd_create_fstype_invalid(self, capsys):
with pytest.raises(SystemExit):
@@ -130,10 +130,6 @@
args = self.parser.parse_args('osd prepare host1:sdb'.split())
assert args.fs_type == "xfs"
- def test_osd_prepare_fstype_ext4(self):
- args = self.parser.parse_args('osd prepare --fs-type ext4 host1:sdb'.split())
- assert args.fs_type == "ext4"
-
def test_osd_prepare_fstype_invalid(self, capsys):
with pytest.raises(SystemExit):
self.parser.parse_args('osd prepare --fs-type bork host1:sdb'.split())
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ceph-deploy-1.5.32+git.1460619432.b539689/ceph_deploy/tests/test_cli_mon.py new/ceph-deploy-1.5.34+git.1470736983.963ba71/ceph_deploy/tests/test_cli_mon.py
--- old/ceph-deploy-1.5.32+git.1460619432.b539689/ceph_deploy/tests/test_cli_mon.py 2016-04-14 09:39:11.000000000 +0200
+++ new/ceph-deploy-1.5.34+git.1470736983.963ba71/ceph_deploy/tests/test_cli_mon.py 2016-08-09 15:22:14.000000000 +0200
@@ -1,9 +1,7 @@
-import argparse
-import collections
import subprocess
import pytest
-from mock import Mock, patch, NonCallableMock
+from mock import Mock, patch
from ceph_deploy.cli import _main as main
from ceph_deploy.tests.directory import directory
@@ -30,7 +28,7 @@
return get_connection
-def test_simple(tmpdir, capsys):
+def test_new(tmpdir, capsys):
with tmpdir.join('ceph.conf').open('w') as f:
f.write("""\
[global]
@@ -38,20 +36,6 @@
mon initial members = host1
""")
- ns = argparse.Namespace()
- ns.pushy = Mock()
- conn = NonCallableMock(name='PushyClient')
- ns.pushy.return_value = conn
-
- mock_compiled = collections.defaultdict(Mock)
- conn.compile.side_effect = mock_compiled.__getitem__
-
- MON_SECRET = 'AQBWDj5QAP6LHhAAskVBnUkYHJ7eYREmKo5qKA=='
-
- def _create_mon(cluster, get_monitor_secret):
- secret = get_monitor_secret()
- assert secret == MON_SECRET
-
fake_ip_addresses = lambda x: ['10.0.0.1']
try:
with patch('ceph_deploy.new.net.ip_addresses', fake_ip_addresses):
@@ -59,14 +43,7 @@
with patch('ceph_deploy.new.arg_validators.Hostname', lambda: lambda x: x):
with patch('ceph_deploy.new.hosts'):
with directory(str(tmpdir)):
- main(
- args=['-v', 'new', '--no-ssh-copykey', 'host1'],
- namespace=ns,
- )
- main(
- args=['-v', 'mon', 'create', 'host1'],
- namespace=ns,
- )
+ main(['-v', 'new', '--no-ssh-copykey', 'host1'])
except SystemExit as e:
raise AssertionError('Unexpected exit: %s', e)
out, err = capsys.readouterr()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ceph-deploy-1.5.32+git.1460619432.b539689/ceph_deploy/tests/test_gather_keys_missing.py new/ceph-deploy-1.5.34+git.1470736983.963ba71/ceph_deploy/tests/test_gather_keys_missing.py
--- old/ceph-deploy-1.5.32+git.1460619432.b539689/ceph_deploy/tests/test_gather_keys_missing.py 1970-01-01 01:00:00.000000000 +0100
+++ new/ceph-deploy-1.5.34+git.1470736983.963ba71/ceph_deploy/tests/test_gather_keys_missing.py 2016-08-09 15:22:14.000000000 +0200
@@ -0,0 +1,163 @@
+from ceph_deploy import gatherkeys
+from ceph_deploy import new
+import mock
+import tempfile
+import shutil
+import os
+import pytest
+
+
+class mock_conn(object):
+ def __init__(self):
+ pass
+
+class mock_distro(object):
+ def __init__(self):
+ self.conn = mock_conn()
+
+class mock_rlogger(object):
+ def error(self, *arg):
+ return
+
+ def debug(self, *arg):
+ return
+
+
+def mock_remoto_process_check_success(conn, args):
+ secret = new.generate_auth_key()
+ out = '[mon.]\nkey = %s\ncaps mon = allow *\n' % secret
+ return out.split('\n'), "", 0
+
+
+def mock_remoto_process_check_rc_error(conn, args):
+ return [""], ["this failed\n"], 1
+
+
+class TestGatherKeysMissing(object):
+ """
+ Since we are testing things that effect the content a directory we should
+ test in a clean empty directory.
+ """
+
+ def setup(self):
+ """
+ Make temp directory for tests.
+ """
+ self.args = mock.Mock()
+ self.distro = mock_distro()
+ self.test_dir = tempfile.mkdtemp()
+ self.rlogger = mock_rlogger()
+ self.keypath_remote = "some_path"
+
+ def teardown(self):
+ """
+ Remove temp directory and content
+ """
+ shutil.rmtree(self.test_dir)
+
+ @mock.patch('ceph_deploy.lib.remoto.process.check', mock_remoto_process_check_success)
+ def test_success_admin(self):
+ keytype = 'admin'
+ rc = gatherkeys.gatherkeys_missing(
+ self.args,
+ self.distro,
+ self.rlogger,
+ self.keypath_remote,
+ keytype,
+ self.test_dir
+ )
+ assert rc is True
+ keyname = gatherkeys.keytype_path_to(self.args, keytype)
+ keypath_gen = os.path.join(self.test_dir, keyname)
+ assert os.path.isfile(keypath_gen)
+
+ @mock.patch('ceph_deploy.lib.remoto.process.check', mock_remoto_process_check_success)
+ def test_success_mds(self):
+ keytype = 'mds'
+ rc = gatherkeys.gatherkeys_missing(
+ self.args,
+ self.distro,
+ self.rlogger,
+ self.keypath_remote,
+ keytype,
+ self.test_dir
+ )
+ assert rc is True
+ keyname = gatherkeys.keytype_path_to(self.args, keytype)
+ keypath_gen = os.path.join(self.test_dir, keyname)
+ assert os.path.isfile(keypath_gen)
+
+ @mock.patch('ceph_deploy.lib.remoto.process.check', mock_remoto_process_check_success)
+ def test_success_osd(self):
+ keytype = 'osd'
+ rc = gatherkeys.gatherkeys_missing(
+ self.args,
+ self.distro,
+ self.rlogger,
+ self.keypath_remote,
+ keytype,
+ self.test_dir
+ )
+ assert rc is True
+ keyname = gatherkeys.keytype_path_to(self.args, keytype)
+ keypath_gen = os.path.join(self.test_dir, keyname)
+ assert os.path.isfile(keypath_gen)
+
+ @mock.patch('ceph_deploy.lib.remoto.process.check', mock_remoto_process_check_success)
+ def test_success_rgw(self):
+ keytype = 'rgw'
+ rc = gatherkeys.gatherkeys_missing(
+ self.args,
+ self.distro,
+ self.rlogger,
+ self.keypath_remote,
+ keytype,
+ self.test_dir
+ )
+ assert rc is True
+ keyname = gatherkeys.keytype_path_to(self.args, keytype)
+ keypath_gen = os.path.join(self.test_dir, keyname)
+ assert os.path.isfile(keypath_gen)
+
+ @mock.patch('ceph_deploy.lib.remoto.process.check', mock_remoto_process_check_rc_error)
+ def test_remoto_process_check_rc_error(self):
+ keytype = 'admin'
+ rc = gatherkeys.gatherkeys_missing(
+ self.args,
+ self.distro,
+ self.rlogger,
+ self.keypath_remote,
+ keytype,
+ self.test_dir
+ )
+ assert rc is False
+ keyname = gatherkeys.keytype_path_to(self.args, keytype)
+ keypath_gen = os.path.join(self.test_dir, keyname)
+ assert not os.path.isfile(keypath_gen)
+
+ @mock.patch('ceph_deploy.lib.remoto.process.check', mock_remoto_process_check_success)
+ def test_fail_identity_missing(self):
+ keytype = 'silly'
+ with pytest.raises(RuntimeError):
+ gatherkeys.gatherkeys_missing(
+ self.args,
+ self.distro,
+ self.rlogger,
+ self.keypath_remote,
+ keytype,
+ self.test_dir
+ )
+
+ @mock.patch('ceph_deploy.lib.remoto.process.check', mock_remoto_process_check_success)
+ def test_fail_capabilities_missing(self):
+ keytype = 'mon'
+ with pytest.raises(RuntimeError):
+ gatherkeys.gatherkeys_missing(
+ self.args,
+ self.distro,
+ self.rlogger,
+ self.keypath_remote,
+ keytype,
+ self.test_dir
+ )
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ceph-deploy-1.5.32+git.1460619432.b539689/ceph_deploy/tests/test_gather_keys_with_mon.py new/ceph-deploy-1.5.34+git.1470736983.963ba71/ceph_deploy/tests/test_gather_keys_with_mon.py
--- old/ceph-deploy-1.5.32+git.1460619432.b539689/ceph_deploy/tests/test_gather_keys_with_mon.py 2016-04-14 09:39:11.000000000 +0200
+++ new/ceph-deploy-1.5.34+git.1470736983.963ba71/ceph_deploy/tests/test_gather_keys_with_mon.py 2016-08-09 15:22:14.000000000 +0200
@@ -51,6 +51,9 @@
def get_file(self, path):
return self.get_file_result
+ def shortname(self):
+ hostname_split = self.longhostname.split('.')
+ return hostname_split[0]
class mock_conn(object):
def __init__(self):
@@ -66,12 +69,14 @@
output = mock_distro()
mon_keyring = '[mon.]\nkey = %s\ncaps mon = allow *\n' % new.generate_auth_key()
output.conn.remote_module.get_file_result = mon_keyring
+ output.conn.remote_module.longhostname = host
return output
def mock_hosts_get_file_key_content_none(host, **kwargs):
output = mock_distro()
output.conn.remote_module.get_file_result = None
+ output.conn.remote_module.longhostname = host
return output
@@ -148,7 +153,7 @@
@mock.patch('ceph_deploy.hosts.get', mock_hosts_get_file_key_content)
def test_success(self):
rc = gatherkeys.gatherkeys_with_mon(self.args, self.host, self.test_dir)
- assert rc == True
+ assert rc is True
@mock.patch('ceph_deploy.gatherkeys.gatherkeys_missing', mock_gatherkeys_missing_success)
@@ -156,7 +161,7 @@
@mock.patch('ceph_deploy.hosts.get', mock_hosts_get_file_key_content_none)
def test_monkey_none(self):
rc = gatherkeys.gatherkeys_with_mon(self.args, self.host, self.test_dir)
- assert rc == False
+ assert rc is False
@mock.patch('ceph_deploy.gatherkeys.gatherkeys_missing', mock_gatherkeys_missing_fail)
@@ -164,7 +169,7 @@
@mock.patch('ceph_deploy.hosts.get', mock_hosts_get_file_key_content)
def test_missing_fail(self):
rc = gatherkeys.gatherkeys_with_mon(self.args, self.host, self.test_dir)
- assert rc == False
+ assert rc is False
@mock.patch('ceph_deploy.gatherkeys.gatherkeys_missing', mock_gatherkeys_missing_success)
@@ -172,7 +177,7 @@
@mock.patch('ceph_deploy.hosts.get', mock_hosts_get_file_key_content)
def test_remoto_process_check_rc_error(self):
rc = gatherkeys.gatherkeys_with_mon(self.args, self.host, self.test_dir)
- assert rc == False
+ assert rc is False
@mock.patch('ceph_deploy.gatherkeys.gatherkeys_missing', mock_gatherkeys_missing_success)
@@ -180,14 +185,14 @@
@mock.patch('ceph_deploy.hosts.get', mock_hosts_get_file_key_content)
def test_remoto_process_check_out_not_json(self):
rc = gatherkeys.gatherkeys_with_mon(self.args, self.host, self.test_dir)
- assert rc == False
+ assert rc is False
@mock.patch('ceph_deploy.gatherkeys.gatherkeys_missing', mock_gatherkeys_missing_success)
@mock.patch('ceph_deploy.lib.remoto.process.check', mock_remoto_process_check_out_missing_quorum)
@mock.patch('ceph_deploy.hosts.get', mock_hosts_get_file_key_content)
def test_remoto_process_check_out_missing_quorum(self):
rc = gatherkeys.gatherkeys_with_mon(self.args, self.host, self.test_dir)
- assert rc == False
+ assert rc is False
@mock.patch('ceph_deploy.gatherkeys.gatherkeys_missing', mock_gatherkeys_missing_success)
@@ -195,7 +200,7 @@
@mock.patch('ceph_deploy.hosts.get', mock_hosts_get_file_key_content)
def test_remoto_process_check_out_missing_quorum_1(self):
rc = gatherkeys.gatherkeys_with_mon(self.args, self.host, self.test_dir)
- assert rc == False
+ assert rc is False
@mock.patch('ceph_deploy.gatherkeys.gatherkeys_missing', mock_gatherkeys_missing_success)
@@ -203,7 +208,7 @@
@mock.patch('ceph_deploy.hosts.get', mock_hosts_get_file_key_content)
def test_remoto_process_check_out_missing_mon(self):
rc = gatherkeys.gatherkeys_with_mon(self.args, self.host, self.test_dir)
- assert rc == False
+ assert rc is False
@mock.patch('ceph_deploy.gatherkeys.gatherkeys_missing', mock_gatherkeys_missing_success)
@@ -211,4 +216,4 @@
@mock.patch('ceph_deploy.hosts.get', mock_hosts_get_file_key_content)
def test_remoto_process_check_out_missing_monmap_host1(self):
rc = gatherkeys.gatherkeys_with_mon(self.args, self.host, self.test_dir)
- assert rc == False
+ assert rc is False
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ceph-deploy-1.5.32+git.1460619432.b539689/ceph_deploy/tests/test_keys_equivalent.py new/ceph-deploy-1.5.34+git.1470736983.963ba71/ceph_deploy/tests/test_keys_equivalent.py
--- old/ceph-deploy-1.5.32+git.1460619432.b539689/ceph_deploy/tests/test_keys_equivalent.py 2016-04-14 09:39:11.000000000 +0200
+++ new/ceph-deploy-1.5.34+git.1470736983.963ba71/ceph_deploy/tests/test_keys_equivalent.py 2016-08-09 15:22:14.000000000 +0200
@@ -29,7 +29,7 @@
f.write(mon_keyring)
-class TestKeysEquivilent(object):
+class TestKeysEquivalent(object):
"""
Since we are testing things that effect the content of the current working
directory we should test in a clean empty directory.
@@ -55,7 +55,7 @@
write_key_mon_with_caps(key_path_01, secret_01)
write_key_mon_with_caps(key_path_02, secret_01)
same = gatherkeys._keyring_equivalent(key_path_01, key_path_02)
- assert same == True
+ assert same is True
def test_different_with_caps(self):
@@ -66,7 +66,7 @@
write_key_mon_with_caps(key_path_01, secret_01)
write_key_mon_with_caps(key_path_02, secret_02)
same = gatherkeys._keyring_equivalent(key_path_01, key_path_02)
- assert same == False
+ assert same is False
def test_identical_without_caps(self):
@@ -76,7 +76,7 @@
write_key_mon_without_caps(key_path_01, secret_01)
write_key_mon_without_caps(key_path_02, secret_01)
same = gatherkeys._keyring_equivalent(key_path_01, key_path_02)
- assert same == True
+ assert same is True
def test_different_without_caps(self):
@@ -87,7 +87,7 @@
write_key_mon_without_caps(key_path_01, secret_01)
write_key_mon_without_caps(key_path_02, secret_02)
same = gatherkeys._keyring_equivalent(key_path_01, key_path_02)
- assert same == False
+ assert same is False
def test_identical_mixed_caps(self):
@@ -97,7 +97,7 @@
write_key_mon_with_caps(key_path_01, secret_01)
write_key_mon_without_caps(key_path_02, secret_01)
same = gatherkeys._keyring_equivalent(key_path_01, key_path_02)
- assert same == True
+ assert same is True
def test_different_mixed_caps(self):
@@ -108,7 +108,7 @@
write_key_mon_with_caps(key_path_01, secret_01)
write_key_mon_without_caps(key_path_02, secret_02)
same = gatherkeys._keyring_equivalent(key_path_01, key_path_02)
- assert same == False
+ assert same is False
def test_identical_caps_mixed_tabs(self):
@@ -118,7 +118,7 @@
write_key_mon_with_caps(key_path_01, secret_01)
write_key_mon_with_caps_with_tab(key_path_02, secret_01)
same = gatherkeys._keyring_equivalent(key_path_01, key_path_02)
- assert same == True
+ assert same is True
def test_different_caps_mixed_tabs(self):
@@ -129,7 +129,7 @@
write_key_mon_with_caps(key_path_01, secret_01)
write_key_mon_with_caps_with_tab(key_path_02, secret_02)
same = gatherkeys._keyring_equivalent(key_path_01, key_path_02)
- assert same == False
+ assert same is False
def test_identical_caps_mixed_quote(self):
@@ -139,7 +139,7 @@
write_key_mon_with_caps_with_tab(key_path_01, secret_01)
write_key_mon_with_caps_with_tab_quote(key_path_02, secret_01)
same = gatherkeys._keyring_equivalent(key_path_01, key_path_02)
- assert same == True
+ assert same is True
def test_different_caps_mixed_quote(self):
@@ -150,7 +150,7 @@
write_key_mon_with_caps_with_tab(key_path_01, secret_01)
write_key_mon_with_caps_with_tab_quote(key_path_02, secret_02)
same = gatherkeys._keyring_equivalent(key_path_01, key_path_02)
- assert same == False
+ assert same is False
def test_missing_key_1(self):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ceph-deploy-1.5.32+git.1460619432.b539689/ceph_deploy/tests/unit/hosts/test_suse.py new/ceph-deploy-1.5.34+git.1470736983.963ba71/ceph_deploy/tests/unit/hosts/test_suse.py
--- old/ceph-deploy-1.5.32+git.1460619432.b539689/ceph_deploy/tests/unit/hosts/test_suse.py 2016-04-14 09:39:11.000000000 +0200
+++ new/ceph-deploy-1.5.34+git.1470736983.963ba71/ceph_deploy/tests/unit/hosts/test_suse.py 2016-08-09 15:22:14.000000000 +0200
@@ -8,7 +8,7 @@
def test_choose_init_default(self):
self.host.release = None
init_type = self.host.choose_init(self.host)
- assert init_type == "sysvinit"
+ assert init_type == "systemd"
def test_choose_init_SLE_11(self):
self.host.release = '11'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ceph-deploy-1.5.32+git.1460619432.b539689/ceph_deploy/util/pkg_managers.py new/ceph-deploy-1.5.34+git.1470736983.963ba71/ceph_deploy/util/pkg_managers.py
--- old/ceph-deploy-1.5.32+git.1460619432.b539689/ceph_deploy/util/pkg_managers.py 2016-04-14 09:39:11.000000000 +0200
+++ new/ceph-deploy-1.5.34+git.1470736983.963ba71/ceph_deploy/util/pkg_managers.py 2016-08-09 15:22:14.000000000 +0200
@@ -297,7 +297,7 @@
packages = [packages]
extra_flags = kw.pop('extra_remove_flags', None)
- cmd = self.executable + ['remove']
+ cmd = self.executable + ['--ignore-unknown', 'remove']
if extra_flags:
if isinstance(extra_flags, str):
extra_flags = [extra_flags]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ceph-deploy-1.5.32+git.1460619432.b539689/ceph_deploy/validate.py new/ceph-deploy-1.5.34+git.1470736983.963ba71/ceph_deploy/validate.py
--- old/ceph-deploy-1.5.32+git.1460619432.b539689/ceph_deploy/validate.py 2016-04-14 09:39:11.000000000 +0200
+++ new/ceph-deploy-1.5.34+git.1470736983.963ba71/ceph_deploy/validate.py 2016-08-09 15:22:14.000000000 +0200
@@ -3,6 +3,7 @@
ALPHANUMERIC_RE = re.compile(r'^[a-zA-Z][a-zA-Z0-9]*$')
+ALPHANUMERICDOT_RE = re.compile(r'^[a-zA-Z][a-zA-Z0-9\.\-\_]*$')
def alphanumeric(s):
@@ -14,3 +15,13 @@
'argument must start with a letter and contain only letters and numbers',
)
return s
+
+def alphanumericdot(s):
+ """
+ Enforces string to be alphanumeric and dot allowed with leading alpha.
+ """
+ if not ALPHANUMERICDOT_RE.match(s):
+ raise argparse.ArgumentTypeError(
+ 'argument must start with a letter and contain only letters and numbers or [.-_]',
+ )
+ return s
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ceph-deploy-1.5.32+git.1460619432.b539689/debian/changelog new/ceph-deploy-1.5.34+git.1470736983.963ba71/debian/changelog
--- old/ceph-deploy-1.5.32+git.1460619432.b539689/debian/changelog 2016-04-14 09:39:11.000000000 +0200
+++ new/ceph-deploy-1.5.34+git.1470736983.963ba71/debian/changelog 2016-08-09 15:22:14.000000000 +0200
@@ -1,3 +1,15 @@
+ceph-deploy (1.5.34) stable; urgency=medium
+
+ * New upstream release
+
+ -- Alfredo Deza