components/openstack/swift/patches/orphans.patch
author Drew Fisher <drew.fisher@oracle.com>
Fri, 13 Jun 2014 09:10:23 -0700
branchs11-update
changeset 3178 77584387a894
parent 3135 0a68f5e884e0
child 5448 56f4540f741d
permissions -rw-r--r--
PSARC/2014/207 OpenStack Glance Update to Havana PSARC/2014/208 OpenStack Cinder Update to Havana PSARC/2014/209 OpenStack Keystone Update to Havana PSARC/2014/210 OpenStack Nova Update to Havana 18416146 Neutron agents (L3 and DHCP) should cleanup resources when they are disabled 18562372 Failed to create a new project under Horizon 18645763 ZFSSA Cinder Driver support 18686327 evs agent silently ignores user-specified pool allocation ranges 18702697 fibre channel volumes should be supported in the cinder volume driver 18734289 nova won't terminate failed kz deployments 18738371 cinder-volume:setup should account for commented-out zfs_volume_base 18738374 cinder-volume:setup should check for existence of configuration file 18826190 nova-compute fails due to nova.utils.to_bytes 18855698 Update OpenStack to Havana 2013.2.3 18855710 Update python-cinderclient to 1.0.9 18855743 Update python-keystoneclient to 0.8.0 18855754 Update python-neutronclient to 2.3.4 18855764 Update python-novaclient to 2.17.0 18855793 Update python-swiftclient to 2.1.0 18856992 External networks can be deleted even when floating IP addresses are in use 18857784 bake in some more openstack configuration 18884923 Incorrect locale facets in python modules for openstack 18913890 the error in _get_view_and_lun may cause the failure of deleting volumes 18943044 Disable 'Security Groups' tab in Horizon dashboard 18969275 problem in SERVICE/KEYSTONE
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3135
0a68f5e884e0 PSARC 2014/050 OpenStack Swift (OpenStack Object Storage Service)
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
     1
Convert the calls to ps in swift-orphans to calls that will work on
0a68f5e884e0 PSARC 2014/050 OpenStack Swift (OpenStack Object Storage Service)
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
     2
Solaris.
0a68f5e884e0 PSARC 2014/050 OpenStack Swift (OpenStack Object Storage Service)
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
     3
0a68f5e884e0 PSARC 2014/050 OpenStack Swift (OpenStack Object Storage Service)
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
     4
diff --git a/bin/swift-orphans b/bin/swift-orphans
0a68f5e884e0 PSARC 2014/050 OpenStack Swift (OpenStack Object Storage Service)
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
     5
--- a/bin/swift-orphans
0a68f5e884e0 PSARC 2014/050 OpenStack Swift (OpenStack Object Storage Service)
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
     6
+++ b/bin/swift-orphans
3178
77584387a894 PSARC/2014/207 OpenStack Glance Update to Havana
Drew Fisher <drew.fisher@oracle.com>
parents: 3135
diff changeset
     7
@@ -54,12 +54,12 @@ Example (sends SIGTERM to all orphaned S
3135
0a68f5e884e0 PSARC 2014/050 OpenStack Swift (OpenStack Object Storage Service)
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
     8
             if name.endswith('.pid'):
0a68f5e884e0 PSARC 2014/050 OpenStack Swift (OpenStack Object Storage Service)
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
     9
                 pids.append(open(os.path.join(root, name)).read().strip())
0a68f5e884e0 PSARC 2014/050 OpenStack Swift (OpenStack Object Storage Service)
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    10
                 pids.extend(subprocess.Popen(
0a68f5e884e0 PSARC 2014/050 OpenStack Swift (OpenStack Object Storage Service)
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    11
-                    ['ps', '--ppid', pids[-1], '-o', 'pid', '--no-headers'],
0a68f5e884e0 PSARC 2014/050 OpenStack Swift (OpenStack Object Storage Service)
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    12
+                    ['pgrep', '-P', pids[-1]],
0a68f5e884e0 PSARC 2014/050 OpenStack Swift (OpenStack Object Storage Service)
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    13
                     stdout=subprocess.PIPE).communicate()[0].split())
0a68f5e884e0 PSARC 2014/050 OpenStack Swift (OpenStack Object Storage Service)
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    14
 
0a68f5e884e0 PSARC 2014/050 OpenStack Swift (OpenStack Object Storage Service)
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    15
     listing = []
0a68f5e884e0 PSARC 2014/050 OpenStack Swift (OpenStack Object Storage Service)
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    16
     for line in subprocess.Popen(
0a68f5e884e0 PSARC 2014/050 OpenStack Swift (OpenStack Object Storage Service)
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    17
-            ['ps', '-eo', 'etime,pid,args', '--no-headers'],
0a68f5e884e0 PSARC 2014/050 OpenStack Swift (OpenStack Object Storage Service)
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    18
+            ['ps', '-eo', 'etime=', '-o' 'pid=', '-o' 'args='],
0a68f5e884e0 PSARC 2014/050 OpenStack Swift (OpenStack Object Storage Service)
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    19
             stdout=subprocess.PIPE).communicate()[0].split('\n'):
0a68f5e884e0 PSARC 2014/050 OpenStack Swift (OpenStack Object Storage Service)
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    20
         if not line:
0a68f5e884e0 PSARC 2014/050 OpenStack Swift (OpenStack Object Storage Service)
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    21
             continue
3178
77584387a894 PSARC/2014/207 OpenStack Glance Update to Havana
Drew Fisher <drew.fisher@oracle.com>
parents: 3135
diff changeset
    22
@@ -70,6 +70,7 @@ Example (sends SIGTERM to all orphaned S
3135
0a68f5e884e0 PSARC 2014/050 OpenStack Swift (OpenStack Object Storage Service)
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    23
             sys.exit('Could not process ps line %r' % line)
0a68f5e884e0 PSARC 2014/050 OpenStack Swift (OpenStack Object Storage Service)
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    24
         if pid in pids:
0a68f5e884e0 PSARC 2014/050 OpenStack Swift (OpenStack Object Storage Service)
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    25
             continue
0a68f5e884e0 PSARC 2014/050 OpenStack Swift (OpenStack Object Storage Service)
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    26
+        # XXX Do we get enough of the arguments to get "once"?
0a68f5e884e0 PSARC 2014/050 OpenStack Swift (OpenStack Object Storage Service)
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    27
         if (not args.startswith('/usr/bin/python /usr/bin/swift-') and
0a68f5e884e0 PSARC 2014/050 OpenStack Swift (OpenStack Object Storage Service)
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    28
             not args.startswith('/usr/bin/python /usr/local/bin/swift-')) or \
0a68f5e884e0 PSARC 2014/050 OpenStack Swift (OpenStack Object Storage Service)
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    29
                 'swift-orphans' in args or \