Commit aadbdacc authored by Thomas Goirand's avatar Thomas Goirand

Merge tag '2.23.0' into debian/train

swift 2.23.0 release

meta:version: 2.23.0
meta:diff-start: -
meta:series: train
meta:release-type: release
meta:pypi: no
meta:first: no
meta:release:Author: Tim Burke <tim.burke@gmail.com>
meta:release:Commit: Tim Burke <tim.burke@gmail.com>
meta:release:Change-Id: I56c2bd6432c1998790735f49e9bad5d4c1d7442f
meta:release:Code-Review+2: Thierry Carrez <thierry@openstack.org>
meta:release:Code-Review+2: Sean McGinnis <sean.mcginnis@gmail.com>
meta:release:Workflow+1: Sean McGinnis <sean.mcginnis@gmail.com>
parents bb178261 8a4becb1
......@@ -22,3 +22,4 @@ subunit.log
test/probe/.noseids
RELEASENOTES.rst
releasenotes/notes/reno.cache
/tools/playbooks/**/*.retry
......@@ -96,6 +96,30 @@
bindep_profile: test py37
python_version: 3.7
- job:
name: swift-tox-func-encryption-py37
parent: swift-tox-func-py37
description: |
Run functional tests for swift under cPython version 3.7.
Uses tox with the ``func-encryption-py3`` environment.
It sets TMPDIR to an XFS mount point created via
tools/test-setup.sh.
vars:
tox_envlist: func-encryption-py3
- job:
name: swift-tox-func-ec-py37
parent: swift-tox-func-py37
description: |
Run functional tests for swift under cPython version 3.7.
Uses tox with the ``func-ec-py3`` environment.
It sets TMPDIR to an XFS mount point created via
tools/test-setup.sh.
vars:
tox_envlist: func-ec-py3
- job:
name: swift-tox-func-domain-remap-staticweb-py37
parent: swift-tox-func-py37
......@@ -108,6 +132,18 @@
vars:
tox_envlist: func-domain-remap-staticweb-py3
- job:
name: swift-tox-func-s3api-py37
parent: swift-tox-func-py37
description: |
Run functional tests for swift under cPython version 3.7.
Uses tox with the ``func-s3api`` environment.
It sets TMPDIR to an XFS mount point created via
tools/test-setup.sh.
vars:
tox_envlist: func-s3api-py3
- job:
name: swift-tox-func-centos-7
parent: swift-tox-func
......@@ -139,7 +175,6 @@
Uses tox with the ``func-ec`` environment.
It sets TMPDIR to an XFS mount point created via
tools/test-setup.sh.
branches: ^(?!stable/ocata).*$
vars:
tox_envlist: func-ec
......@@ -210,8 +245,10 @@
parent: swift-dsvm-functional
description: |
Setup a Swift/Keystone environment under py3 and run Swift's func tests
(but under py2).
(also under py3).
vars:
# This tox env get run twice; once for Keystone and once for tempauth
tox_envlist: func-py3
devstack_localrc:
USE_PYTHON3: true
# explicitly clear swift's default-disabled status
......@@ -223,8 +260,7 @@
vars:
devstack_localrc:
SERVICE_IP_VERSION: 6
HOST_IPV6: '[::1]'
SERVICE_HOST: '[::1]'
SERVICE_HOST: ""
- job:
name: swift-tox-func-s3api-ceph-s3tests-tempauth
......@@ -236,6 +272,7 @@
pre-run:
- tools/playbooks/common/install_dependencies.yaml
- tools/playbooks/saio_single_node_setup/setup_saio.yaml
- tools/playbooks/saio_single_node_setup/add_s3api.yaml
- tools/playbooks/saio_single_node_setup/make_rings.yaml
run: tools/playbooks/ceph-s3tests/run.yaml
post-run:
......@@ -325,6 +362,12 @@
vars:
previous_swift_version: origin/stable/rocky
- job:
name: swift-multinode-rolling-upgrade-stein
parent: swift-multinode-rolling-upgrade
vars:
previous_swift_version: origin/stable/stein
- job:
name: swift-tox-lower-constraints
parent: openstack-tox-lower-constraints
......@@ -387,12 +430,15 @@
- periodic-stable-jobs
- check-requirements
- release-notes-jobs-python3
- integrated-gate-object-storage
check:
jobs:
- swift-build-image:
irrelevant-files:
- ^(api-ref|doc|releasenotes)/.*$
- ^test/(functional|probe)/.*$
# Unit tests
- swift-tox-py27:
irrelevant-files:
- ^(api-ref|doc|releasenotes)/.*$
......@@ -401,21 +447,17 @@
irrelevant-files:
- ^(api-ref|doc|releasenotes)/.*$
- ^test/(functional|probe)/.*$
voting: false
- swift-tox-py37:
irrelevant-files:
- ^(api-ref|doc|releasenotes)/.*$
- ^test/(functional|probe)/.*$
# Functional tests
- swift-tox-func:
irrelevant-files:
- ^(api-ref|doc|releasenotes)/.*$
- ^test/probe/.*$
- ^(.gitreview|.mailmap|AUTHORS|CHANGELOG)$
- swift-tox-func-py37:
irrelevant-files:
- ^(api-ref|doc|releasenotes)/.*$
- ^test/probe/.*$
- ^(.gitreview|.mailmap|AUTHORS|CHANGELOG)$
- swift-tox-func-encryption:
irrelevant-files:
- ^(api-ref|doc|releasenotes)/.*$
......@@ -436,11 +478,35 @@
- ^(api-ref|doc|releasenotes)/.*$
- ^test/probe/.*$
- ^(.gitreview|.mailmap|AUTHORS|CHANGELOG)$
# py3 functional tests
- swift-tox-func-py37:
irrelevant-files:
- ^(api-ref|doc|releasenotes)/.*$
- ^test/probe/.*$
- ^(.gitreview|.mailmap|AUTHORS|CHANGELOG)$
- swift-tox-func-encryption-py37:
irrelevant-files:
- ^(api-ref|doc|releasenotes)/.*$
- ^test/probe/.*$
- ^(.gitreview|.mailmap|AUTHORS|CHANGELOG)$
- swift-tox-func-domain-remap-staticweb-py37:
irrelevant-files:
- ^(api-ref|doc|releasenotes)/.*$
- ^test/probe/.*$
- ^(.gitreview|.mailmap|AUTHORS|CHANGELOG)$
- swift-tox-func-ec-py37:
irrelevant-files:
- ^(api-ref|doc|releasenotes)/.*$
- ^test/probe/.*$
- ^(.gitreview|.mailmap|AUTHORS|CHANGELOG)$
- swift-tox-func-s3api-py37:
irrelevant-files:
- ^(api-ref|doc|releasenotes)/.*$
- ^test/probe/.*$
- ^(.gitreview|.mailmap|AUTHORS|CHANGELOG)$
# Other tests
- swift-tox-func-s3api-ceph-s3tests-tempauth:
irrelevant-files:
- ^(api-ref|releasenotes)/.*$
......@@ -485,7 +551,21 @@
- ^(api-ref|doc|releasenotes)/.*$
- ^test/probe/.*$
- ^(.gitreview|.mailmap|AUTHORS|CHANGELOG)$
voting: false
- tempest-integrated-object-storage:
irrelevant-files:
- ^(api-ref|doc|releasenotes)/.*$
- ^test/.*$
- ^(.gitreview|.mailmap|AUTHORS|CHANGELOG)$
- tempest-ipv6-only:
irrelevant-files:
- ^(api-ref|doc|releasenotes)/.*$
- ^test/.*$
- ^(.gitreview|.mailmap|AUTHORS|CHANGELOG)$
- grenade-py3:
irrelevant-files:
- ^(api-ref|doc|releasenotes)/.*$
- ^test/.*$
- ^(.gitreview|.mailmap|AUTHORS|CHANGELOG)$
gate:
jobs:
# For gate jobs, err towards running more jobs (so, generally avoid
......@@ -494,14 +574,18 @@
# in-tree definitions) dsvm jobs.
- swift-upload-image
- swift-tox-py27
- swift-tox-py36
- swift-tox-py37
- swift-tox-func
- swift-tox-func-py37
- swift-tox-func-encryption
- swift-tox-func-domain-remap-staticweb
- swift-tox-func-ec
- swift-tox-func-s3api
- swift-tox-func-py37
- swift-tox-func-encryption
- swift-tox-func-domain-remap-staticweb-py37
- swift-tox-func-ec-py37
- swift-tox-func-s3api-py37
- swift-probetests-centos-7:
irrelevant-files:
- ^(api-ref|releasenotes)/.*$
......@@ -533,6 +617,21 @@
- ^(api-ref|etc|examples|releasenotes)/.*$
# Keep doc/manpages -- we want to syntax check them
- ^doc/(requirements.txt|(saio|s3api|source)/.*)$
- tempest-integrated-object-storage:
irrelevant-files:
- ^(api-ref|doc|releasenotes)/.*$
- ^test/.*$
- ^(.gitreview|.mailmap|AUTHORS|CHANGELOG)$
- tempest-ipv6-only:
irrelevant-files:
- ^(api-ref|doc|releasenotes)/.*$
- ^test/.*$
- ^(.gitreview|.mailmap|AUTHORS|CHANGELOG)$
- grenade-py3:
irrelevant-files:
- ^(api-ref|doc|releasenotes)/.*$
- ^test/.*$
- ^(.gitreview|.mailmap|AUTHORS|CHANGELOG)$
experimental:
jobs:
- swift-tox-py27-centos-7
......@@ -541,6 +640,7 @@
- swift-tox-func-ec-centos-7
- swift-multinode-rolling-upgrade-queens
- swift-multinode-rolling-upgrade-rocky
- swift-multinode-rolling-upgrade-stein
post:
jobs:
......
......@@ -58,6 +58,7 @@ Anh Tran (anhtt@vn.fujitsu.com)
Ankur Gupta (ankur.gupta@intel.com)
Anne Gentle (anne@openstack.org)
Arnaud JOST (arnaud.jost@ovh.net)
arzhna (arzhna@gmail.com)
Atsushi Sakai (sakaia@jp.fujitsu.com)
Azhagu Selvan SP (tamizhgeek@gmail.com)
baiwenteng (baiwenteng@inspur.com)
......@@ -107,6 +108,7 @@ Constantine Peresypkin (constantine.peresypk@rackspace.com)
Corey Bryant (corey.bryant@canonical.com)
Cory Wright (cory.wright@rackspace.com)
Cristian A Sanchez (cristian.a.sanchez@intel.com)
CY Chiang (cychiang@cht.com.tw)
Cyril Roelandt (cyril@redhat.com)
Dae S. Kim (dae@velatum.com)
Daisuke Morita (morita.daisuke@ntti3.com)
......@@ -173,6 +175,7 @@ gecong1973 (ge.cong@zte.com.cn)
gengchc2 (geng.changcai2@zte.com.cn)
Gerard Gine (ggine@swiftstack.com)
Gerry Drudy (gerry.drudy@hpe.com)
Ghanshyam Mann (gmann@ghanshyammann.com)
Gil Vernik (gilv@il.ibm.com)
Gilles Biannic (gilles.biannic@corp.ovh.com)
Gleb Samsonov (sams-gleb@yandex.ru)
......@@ -307,6 +310,7 @@ Ngo Quoc Cuong (cuongnq@vn.fujitsu.com)
Nguyen Hai (nguyentrihai93@gmail.com)
Nguyen Hung Phuong (phuongnh@vn.fujitsu.com)
Nguyen Phuong An (AnNP@vn.fujitsu.com)
Nguyen Quoc Viet (nguyenqviet98@gmail.com)
Nicolas Helgeson (nh202b@att.com)
Nicolas Trangez (ikke@nicolast.be)
Ning Zhang (ning@zmanda.com)
......@@ -323,6 +327,7 @@ Paul McMillan (paul.mcmillan@nebula.com)
Pavel Kvasnička (pavel.kvasnicka@firma.seznam.cz)
Pawel Palucki (pawel.palucki@gmail.com)
Pearl Yajing Tan (pearl.y.tan@seagate.com)
pengyuesheng (pengyuesheng@gohighsec.com)
Pete Zaitcev (zaitcev@kotori.zaitcev.us)
Peter Lisák (peter.lisak@gmail.com)
Peter Portante (peter.portante@redhat.com)
......
swift (2.23.0, OpenStack Train)
* Python 3.6 and 3.7 are now fully supported. Several py3-related
fixes are included:
* Removed a request-smuggling vector when running a mixed
py2/py3 cluster.
* Allow fallocate_reserve to be specified as a percentage.
* Fixed listings for sharded containers.
* Fixed non-ASCII account metadata handling.
* Fixed rsync output parsing.
* Fixed some title-casing of headers.
If you've been testing Swift on Python 3, upgrade at your earliest
convenience.
* Added "static symlinks", which perform some validation as they
follow redirects and include more information about their target
in container listings.
* Multi-character strings may now be used as delimiters in account
and container listings.
* Sharding improvements
* Container metadata related to sharding are now removed when no
longer needed.
* Empty container databases (such as might be created on handoffs)
now shard much more quickly.
* The proxy-server now ignores 404 responses from handoffs that have
no data when deciding on the correct response for object requests,
similar to what it already does for account and container requests.
* Static Large Object sizes in listings for versioned containers are
now more accurate.
* When refetching Static Large Object manifests, non-manifest responses
are now handled better.
* S3 API now translates 503 Service Unavailable responses to a more
S3-like response instead of raising an error.
* Improved proxy-to-backend requests to be more RFC-compliant.
* Dependency update: eventlet must be at least 0.25.0. This also
dragged forward minimum-supported versions of dnspython (1.15.0),
greenlet (0.3.2), and six (1.10.0).
* Various other minor bug fixes and improvements.
swift (2.22.0)
* Experimental support for Python 3.6 and 3.7 is now available.
......@@ -73,7 +131,8 @@ swift (2.22.0)
* Various other minor bug fixes and improvements.
swift (2.21.0, OpenStack Stein release)
swift (2.21.0, OpenStack Stein)
* Change the behavior of the EC reconstructor to perform a
fragment rebuild to a handoff node when a primary peer responds
......@@ -131,6 +190,7 @@ swift (2.21.0, OpenStack Stein release)
* Various other minor bug fixes and improvements.
swift (2.20.0)
* S3 API compatibility updates
......@@ -237,7 +297,8 @@ swift (2.20.0)
* Various other minor bug fixes and improvements.
2.19.1 (rocky stable backports)
swift (2.19.1, rocky stable backports)
* Prevent PyKMIP's kmip_protocol logger from logging at DEBUG.
Previously, some versions of PyKMIP would include all wire
......@@ -251,6 +312,7 @@ swift (2.20.0)
* Fixed a bug in how Swift uses eventlet that was exposed under high
concurrency.
swift (2.19.0, OpenStack Rocky)
* TempURLs now support IP range restrictions. Please see
......@@ -341,6 +403,7 @@ swift (2.19.0, OpenStack Rocky)
* Various other minor bug fixes and improvements.
swift (2.18.0)
* Added container sharding, an operator controlled feature that
......@@ -414,7 +477,8 @@ swift (2.18.0)
* Various other minor bug fixes and improvements.
2.17.1 (queens stable backports)
swift (2.17.1, queens stable backports)
* Fix SLO delete for accounts with non-ASCII names.
......@@ -424,6 +488,7 @@ swift (2.18.0)
* Fixed a bug in how Swift uses eventlet that was exposed under high
concurrency.
swift (2.17.0, OpenStack Queens)
* Added symlink objects support.
......@@ -616,7 +681,8 @@ swift (2.16.0)
* Various other minor bug fixes and improvements.
2.15.2 (pike stable backports)
swift (2.15.2, pike stable backports)
* Fixed a cache invalidation issue related to GET and PUT requests to
containers that would occasionally cause object PUTs to a container to
......@@ -636,6 +702,7 @@ swift (2.16.0)
* Send ETag header in 206 Partial Content responses to SLO reads.
swift (2.15.1, OpenStack Pike)
* Fixed a bug introduced in 2.15.0 where the object reconstructor
......@@ -1054,7 +1121,7 @@ swift (2.10.0, OpenStack Newton)
improved in clusters that are not completely healthy.
* Significant improvements to the api-ref doc available at
https://developer.openstack.org/api-ref/object-storage/.
https://docs.openstack.org/api-ref/object-store/.
* A PUT or POST to a container will now update the container's
Last-Modified time, and that value will be included in a
......@@ -3062,6 +3129,7 @@ swift (1.4.0)
* Stats uploaders now allow overrides for source_filename_pattern and
new_log_cutoff values.
----
Changelog entries for previous versions are incomplete
......
################################################
#
# Alpine 3.7 Swift-All-In-One
# Alpine 3.10.1 Swift-All-In-One
#
################################################
FROM alpine:3.7
FROM alpine:3.10.1
MAINTAINER Openstack Swift
ENV S6_LOGGING 1
......@@ -35,6 +35,11 @@ RUN mkdir /etc/swift && \
echo && \
echo && \
echo && \
echo "================ starting apk_install_py2 ===================" && \
/opt/swift/docker/install_scripts/20_apk_install_py2.sh && \
echo && \
echo && \
echo && \
echo "================ starting swift_install ===================" && \
/opt/swift/docker/install_scripts/50_swift_install.sh && \
echo && \
......
################################################
#
# Alpine 3.10.1 Swift-All-In-One
#
################################################
FROM alpine:3.10.1
MAINTAINER Openstack Swift
ENV S6_LOGGING 1
ENV S6_VERSION 1.21.4.0
ENV SOCKLOG_VERSION 3.0.1-1
ENV ARCH amd64
ENV BUILD_DIR "/tmp"
ENV ENV="/etc/profile"
#COPY docker/install_scripts /install_scripts
COPY . /opt/swift
ADD https://github.com/just-containers/s6-overlay/releases/download/v$S6_VERSION/s6-overlay-$ARCH.tar.gz /tmp/
ADD https://github.com/just-containers/s6-overlay/releases/download/v$S6_VERSION/s6-overlay-$ARCH.tar.gz.sig /tmp/
ADD https://github.com/just-containers/socklog-overlay/releases/download/v$SOCKLOG_VERSION/socklog-overlay-$ARCH.tar.gz /tmp/
RUN mkdir /etc/swift && \
echo && \
echo && \
echo && \
echo "================ starting swift_needs ===================" && \
/opt/swift/docker/install_scripts/00_swift_needs.sh && \
echo && \
echo && \
echo && \
echo "================ starting apk_install_prereqs ===================" && \
/opt/swift/docker/install_scripts/10_apk_install_prereqs.sh && \
echo && \
echo && \
echo && \
echo "================ starting apk_install_py3 ===================" && \
/opt/swift/docker/install_scripts/21_apk_install_py3.sh && \
echo && \
echo && \
echo && \
echo "================ starting swift_install ===================" && \
/opt/swift/docker/install_scripts/50_swift_install.sh && \
echo && \
echo && \
echo && \
echo "================ installing s6-overlay ===================" && \
curl https://keybase.io/justcontainers/key.asc | gpg --import && \
gpg --verify /tmp/s6-overlay-$ARCH.tar.gz.sig /tmp/s6-overlay-$ARCH.tar.gz && \
gunzip -c /tmp/s6-overlay-$ARCH.tar.gz | tar -xf - -C / && \
gunzip -c /tmp/socklog-overlay-amd64.tar.gz | tar -xf - -C / && \
rm -rf /tmp/s6-overlay* && \
rm -rf /tmp/socklog-overlay* && \
echo && \
echo && \
echo && \
echo "================ starting pip_uninstall_dev ===================" && \
/opt/swift/docker/install_scripts/60_pip_uninstall_dev.sh && \
echo && \
echo && \
echo && \
echo "================ starting apk_uninstall_dev ===================" && \
/opt/swift/docker/install_scripts/99_apk_uninstall_dev.sh && \
echo && \
echo && \
echo && \
echo "================ clean up ===================" && \
echo "TODO: cleanup"
#rm -rf /opt/swift
# Add Swift required configuration files
COPY docker/rootfs /
ENTRYPOINT ["/init"]
......@@ -147,7 +147,7 @@ For client applications, official Python language bindings are provided
at https://github.com/openstack/python-swiftclient.
Complete API documentation at
https://developer.openstack.org/api-ref/object-store/
https://docs.openstack.org/api-ref/object-store/
There is a large ecosystem of applications and libraries that support and
work with OpenStack Swift. Several are listed on the
......
......@@ -23,6 +23,7 @@
# All configuration values have a default; values that are commented out
# serve to show the default.
import datetime
import os
from swift import __version__
import subprocess
......@@ -154,20 +155,22 @@ pygments_style = 'sphinx'
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
# html_last_updated_fmt = '%b %d, %Y'
git_cmd = ["git", "log", "--pretty=format:'%ad, commit %h'", "--date=local",
"-n1"]
try:
html_last_updated_fmt = subprocess.Popen(
git_cmd, stdout=subprocess.PIPE).communicate()[0]
except OSError:
warnings.warn('Cannot get last updated time from git repository. '
'Not setting "html_last_updated_fmt".')
if 'SOURCE_DATE_EPOCH' in os.environ:
now = float(os.environ.get('SOURCE_DATE_EPOCH'))
html_last_updated_fmt = datetime.datetime.utcfromtimestamp(now).isoformat()
else:
if not isinstance(html_last_updated_fmt, str):
# for py3
html_last_updated_fmt = html_last_updated_fmt.decode('ascii')
git_cmd = ["git", "log", "--pretty=format:'%ad, commit %h'", "--date=local",
"-n1"]
try:
html_last_updated_fmt = subprocess.Popen(
git_cmd, stdout=subprocess.PIPE).communicate()[0]
except OSError:
warnings.warn('Cannot get last updated time from git repository. '
'Not setting "html_last_updated_fmt".')
else:
if not isinstance(html_last_updated_fmt, str):
# for py3
html_last_updated_fmt = html_last_updated_fmt.decode('ascii')
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
# html_use_smartypants = True
......
......@@ -16,9 +16,7 @@
# B106 : hardcoded_password_funcarg
# B107 : hardcoded_password_default
# B108 : hardcoded_tmp_directory
# B109 : password_config_option_not_marked_secret
# B110 : try_except_pass
# B111 : execute_with_run_as_root_equals_true
# B112 : try_except_continue
# B201 : flask_debug_true
# B301 : pickle
......@@ -42,6 +40,9 @@
# B319 : xml_bad_pulldom
# B320 : xml_bad_etree
# B321 : ftplib
# B322 : input
# B323 : unverified_context
# B325 : tempnam
# B401 : import_telnetlib
# B402 : import_ftplib
# B403 : import_pickle
......@@ -54,12 +55,15 @@
# B410 : import_lxml
# B411 : import_xmlrpclib
# B412 : import_httpoxy
# B413 : import_pycrypto
# B414 : import_pycryptodome
# B501 : request_with_no_cert_validation
# B502 : ssl_with_bad_version
# B503 : ssl_with_bad_defaults
# B504 : ssl_with_no_version
# B505 : weak_cryptographic_key
# B506 : yaml_load
# B507 : ssh_no_host_key_verification
# B601 : paramiko_calls
# B602 : subprocess_popen_with_shell_equals_true
# B603 : subprocess_without_shell_equals_true
......@@ -69,8 +73,11 @@
# B607 : start_process_with_partial_path
# B608 : hardcoded_sql_expressions
# B609 : linux_commands_wildcard_injection
# B610 : django_extra_used
# B611 : django_rawsql_used
# B701 : jinja2_autoescape_false
# B702 : use_of_mako_templates
# B703 : django_mark_safe
# (optional) list included test IDs here, eg '[B101, B406]':
tests: [B102, B103, B302, B306, B308, B309, B310, B401, B501, B502, B506, B601, B602, B609]
......
......@@ -15,6 +15,7 @@
from __future__ import print_function
import optparse
import os
import re
import signal
import subprocess
import sys
......@@ -52,31 +53,34 @@ Example (sends SIGTERM to all orphaned Swift processes older than two hours):
for root, directories, files in os.walk(options.run_dir):
for name in files:
if name.endswith('.pid'):
if name.endswith(('.pid', '.pid.d')):
pids.append(open(os.path.join(root, name)).read().strip())
pids.extend(subprocess.Popen(
['ps', '--ppid', pids[-1], '-o', 'pid', '--no-headers'],
stdout=subprocess.PIPE).communicate()[0].split())
stdout=subprocess.PIPE).communicate()[0].decode().split())
listing = []
swift_cmd_re = re.compile(
'^/usr/bin/python[23]? /usr(?:/local)?/bin/swift-')
for line in subprocess.Popen(
['ps', '-eo', 'etime,pid,args', '--no-headers'],
stdout=subprocess.PIPE).communicate()[0].split('\n'):
stdout=subprocess.PIPE).communicate()[0].split(b'\n'):
if not line:
continue
hours = 0
try:
etime, pid, args = line.split(None, 2)
etime, pid, args = line.decode('ascii').split(None, 2)
except ValueError:
sys.exit('Could not process ps line %r' % line)
if pid in pids:
continue
if (not args.startswith('/usr/bin/python /usr/bin/swift-') and
not args.startswith('/usr/bin/python /usr/local/bin/swift-')) or \
'swift-orphans' in args or \
'once' in args.split():
if any([
not swift_cmd_re.match(args),
'swift-orphans' in args,
'once' in args.split(),
]):
continue
args = args.split('-', 1)[1]
args = args.split('swift-', 1)[1]
etime = etime.split('-')
if len(etime) == 2:
hours = int(etime[0]) * 24
......@@ -105,11 +109,11 @@ Example (sends SIGTERM to all orphaned Swift processes older than two hours):
args_len = max(args_len, len(args))
args_len = min(args_len, 78 - hours_len - pid_len)
print(('%%%ds %%%ds %%s' % (hours_len, pid_len)) %
('Hours', 'PID', 'Command'))
print('%*s %*s %s' %
(hours_len, 'Hours', pid_len, 'PID', 'Command'))
for hours, pid, args in listing:
print(('%%%ds %%%ds %%s' % (hours_len, pid_len)) %
(hours, pid, args[:args_len]))
print('%*s %*s %s' %
(hours_len, hours, pid_len, pid, args[:args_len]))
if options.signal:
try:
......
......@@ -113,7 +113,7 @@ Swift StatsD logging
~~~~~~~~~~~~~~~~~~~~
StatsD (see `Measure Anything, Measure Everything
<http://codeascraft.etsy.com/2011/02/15/measure-anything-measure-everything/>`_)
<https://codeascraft.com/2011/02/15/measure-anything-measure-everything/>`_)
was designed for application code to be deeply instrumented. Meters are
sent in real-time by the code that just noticed or did something. The
overhead of sending a meter is extremely low: a ``sendto`` of one UDP
......