More fixups for rhel6 + some ubuntu class name cleanups
This commit is contained in:
parent
1e39dc1dc2
commit
2a30054978
@ -1,8 +1,8 @@
|
|||||||
---
|
---
|
||||||
# RedHat Enterprise Linux 6
|
# RedHat Enterprise Linux 6
|
||||||
distro_pattern: redhat-6\\.2
|
distro_pattern: redhat-6(.*)
|
||||||
name: rhel-6
|
name: rhel-6
|
||||||
packager_name: devstack.packaging.yum:YumPackager
|
packager_name: devstack.distros.rhel6:YumPackager
|
||||||
commands:
|
commands:
|
||||||
apache:
|
apache:
|
||||||
restart:
|
restart:
|
||||||
@ -10,7 +10,7 @@ commands:
|
|||||||
- httpd
|
- httpd
|
||||||
- restart
|
- restart
|
||||||
settings:
|
settings:
|
||||||
# Ensure runs after wsgi.conf (naming wise)
|
# Ensure runs after wsgi.conf (file naming wise)
|
||||||
conf-link-target: /etc/httpd/conf.d/wsgi-horizon-000-default.conf
|
conf-link-target: /etc/httpd/conf.d/wsgi-horizon-000-default.conf
|
||||||
start:
|
start:
|
||||||
- service
|
- service
|
||||||
@ -83,6 +83,7 @@ components:
|
|||||||
stop: devstack.components.db:DBRuntime
|
stop: devstack.components.db:DBRuntime
|
||||||
uninstall: devstack.components.db:DBUninstaller
|
uninstall: devstack.components.db:DBUninstaller
|
||||||
general:
|
general:
|
||||||
|
install: devstack.components.pkglist:Installer
|
||||||
packages:
|
packages:
|
||||||
- name: coreutils
|
- name: coreutils
|
||||||
removable: false
|
removable: false
|
||||||
@ -181,7 +182,18 @@ components:
|
|||||||
- name: wget
|
- name: wget
|
||||||
removable: false
|
removable: false
|
||||||
version: 1.12*
|
version: 1.12*
|
||||||
|
pips:
|
||||||
|
- name: coverage
|
||||||
|
version: 3.5.1
|
||||||
|
- name: mock
|
||||||
|
version: 0.8.0
|
||||||
|
- name: nose
|
||||||
|
version: 1.1.2
|
||||||
|
start: devstack.component:EmptyRuntime
|
||||||
|
stop: devstack.component:EmptyRuntime
|
||||||
|
uninstall: devstack.components.pkglist:Uninstaller
|
||||||
glance:
|
glance:
|
||||||
|
install: devstack.components.glance:GlanceInstaller
|
||||||
packages:
|
packages:
|
||||||
- name: MySQL-python
|
- name: MySQL-python
|
||||||
removable: true
|
removable: true
|
||||||
@ -219,7 +231,23 @@ components:
|
|||||||
name: pyxattr
|
name: pyxattr
|
||||||
removable: true
|
removable: true
|
||||||
version: 0.5*
|
version: 0.5*
|
||||||
|
pips:
|
||||||
|
- name: PasteDeploy
|
||||||
|
version: 1.5.0
|
||||||
|
- name: Routes
|
||||||
|
version: 1.12.3
|
||||||
|
- name: SQLAlchemy
|
||||||
|
version: 0.7.5
|
||||||
|
- name: iso8601
|
||||||
|
version: 0.1.4
|
||||||
|
- name: pycrypto
|
||||||
|
options: --upgrade
|
||||||
|
version: '2.5'
|
||||||
|
start: devstack.components.glance:GlanceRuntime
|
||||||
|
stop: devstack.components.glance:GlanceRuntime
|
||||||
|
uninstall: devstack.components.glance:GlanceUninstaller
|
||||||
horizon:
|
horizon:
|
||||||
|
install: devstack.distros.rhel6:HorizonInstaller
|
||||||
packages:
|
packages:
|
||||||
- name: httpd
|
- name: httpd
|
||||||
removable: true
|
removable: true
|
||||||
@ -245,7 +273,43 @@ components:
|
|||||||
name: python-webob1.0
|
name: python-webob1.0
|
||||||
removable: true
|
removable: true
|
||||||
version: 1.0*
|
version: 1.0*
|
||||||
|
pips:
|
||||||
|
- name: CherryPy
|
||||||
|
version: 3.2.2
|
||||||
|
- name: Paste
|
||||||
|
version: 1.7.5.1
|
||||||
|
- name: PasteDeploy
|
||||||
|
version: '1.5'
|
||||||
|
- name: PasteScript
|
||||||
|
version: 1.7.5
|
||||||
|
- name: Routes
|
||||||
|
version: 1.12.3
|
||||||
|
- name: SQLAlchemy
|
||||||
|
version: 0.7.5
|
||||||
|
- name: django
|
||||||
|
version: 1.3.1
|
||||||
|
- name: django-mailer
|
||||||
|
version: 0.1.0
|
||||||
|
- name: django-nose
|
||||||
|
version: 0.1.3
|
||||||
|
- name: django-nose-selenium
|
||||||
|
version: 0.7.3
|
||||||
|
- name: django-registration
|
||||||
|
version: '0.7'
|
||||||
|
- name: django-staticfiles
|
||||||
|
version: 1.1.2
|
||||||
|
- name: pycrypto
|
||||||
|
options: --upgrade
|
||||||
|
version: '2.5'
|
||||||
|
- name: python-cloudfiles
|
||||||
|
version: 1.7.9.3
|
||||||
|
- name: sqlalchemy-migrate
|
||||||
|
version: 0.7.2
|
||||||
|
start: devstack.components.horizon:HorizonRuntime
|
||||||
|
stop: devstack.components.horizon:HorizonRuntime
|
||||||
|
uninstall: devstack.components.horizon:HorizonUninstaller
|
||||||
keystone:
|
keystone:
|
||||||
|
install: devstack.components.keystone:KeystoneInstaller
|
||||||
packages:
|
packages:
|
||||||
- name: MySQL-python
|
- name: MySQL-python
|
||||||
removable: true
|
removable: true
|
||||||
@ -300,7 +364,29 @@ components:
|
|||||||
- name: sqlite
|
- name: sqlite
|
||||||
removable: false
|
removable: false
|
||||||
version: 3.6*
|
version: 3.6*
|
||||||
|
pips:
|
||||||
|
- name: Paste
|
||||||
|
version: 1.7.5.1
|
||||||
|
- name: PasteDeploy
|
||||||
|
version: '1.5'
|
||||||
|
- name: PasteScript
|
||||||
|
version: 1.7.5
|
||||||
|
- name: Routes
|
||||||
|
version: 1.12.3
|
||||||
|
- name: SQLAlchemy
|
||||||
|
version: 0.7.5
|
||||||
|
- name: py-bcrypt
|
||||||
|
version: '0.2'
|
||||||
|
- name: pycrypto
|
||||||
|
options: --upgrade
|
||||||
|
version: '2.5'
|
||||||
|
- name: sqlalchemy-migrate
|
||||||
|
version: 0.7.2
|
||||||
|
start: devstack.components.keystone:KeystoneRuntime
|
||||||
|
stop: devstack.components.keystone:KeystoneRuntime
|
||||||
|
uninstall: devstack.components.keystone:KeystoneUninstaller
|
||||||
keystone-client:
|
keystone-client:
|
||||||
|
install: devstack.components.keystone_client:KeyStoneClientInstaller
|
||||||
packages:
|
packages:
|
||||||
- meta:
|
- meta:
|
||||||
epel: true
|
epel: true
|
||||||
@ -312,59 +398,24 @@ components:
|
|||||||
name: python-prettytable
|
name: python-prettytable
|
||||||
removable: true
|
removable: true
|
||||||
version: 0.5*
|
version: 0.5*
|
||||||
|
start: devstack.components.keystone_client:KeyStoneClientRuntime
|
||||||
|
stop: devstack.components.keystone_client:KeyStoneClientRuntime
|
||||||
|
uninstall: devstack.components.keystone_client:KeyStoneClientUninstaller
|
||||||
melange:
|
melange:
|
||||||
packages: null
|
install: devstack.components.melange:MelangeInstaller
|
||||||
n-api:
|
start: devstack.components.melange:MelangeRuntime
|
||||||
packages:
|
stop: devstack.components.melange:MelangeRuntime
|
||||||
- name: python-dateutil
|
uninstall: devstack.components.melange:MelangeUninstaller
|
||||||
removable: false
|
no-vnc:
|
||||||
version: 1.4*
|
install: devstack.components.novnc:NoVNCInstaller
|
||||||
n-cpu:
|
pips:
|
||||||
packages:
|
- name: numpy
|
||||||
- name: iscsi-initiator-utils
|
version: '1.5'
|
||||||
removable: true
|
start: devstack.components.novnc:NoVNCRuntime
|
||||||
version: 6.2*
|
stop: devstack.components.novnc:NoVNCRuntime
|
||||||
- name: libguestfs
|
uninstall: devstack.components.novnc:NoVNCUninstaller
|
||||||
removable: true
|
|
||||||
version: 1.2.7*
|
|
||||||
- name: libguestfs-mount
|
|
||||||
removable: true
|
|
||||||
version: 1.7.17*
|
|
||||||
- name: libguestfs-tools
|
|
||||||
removable: true
|
|
||||||
version: 1.7.17*
|
|
||||||
- name: libvirt
|
|
||||||
removable: true
|
|
||||||
version: 0.9.4*
|
|
||||||
- name: libvirt-client
|
|
||||||
removable: true
|
|
||||||
version: 0.9.4*
|
|
||||||
- name: libvirt-python
|
|
||||||
removable: true
|
|
||||||
version: 0.9.4*
|
|
||||||
- name: lvm2
|
|
||||||
removable: true
|
|
||||||
version: 2.02*
|
|
||||||
- name: qemu-img
|
|
||||||
removable: true
|
|
||||||
version: 0.12*
|
|
||||||
- name: qemu-kvm
|
|
||||||
removable: true
|
|
||||||
version: 2*
|
|
||||||
n-vnc:
|
|
||||||
packages: null
|
|
||||||
n-vol:
|
|
||||||
packages:
|
|
||||||
- name: iscsi-initiator-utils
|
|
||||||
removable: true
|
|
||||||
version: 6.2*
|
|
||||||
- name: lvm2
|
|
||||||
removable: true
|
|
||||||
version: 2.02*
|
|
||||||
- name: scsi-target-utils
|
|
||||||
removable: true
|
|
||||||
version: 1.0*
|
|
||||||
nova:
|
nova:
|
||||||
|
install: devstack.components.nova:NovaInstaller
|
||||||
packages:
|
packages:
|
||||||
- name: MySQL-python
|
- name: MySQL-python
|
||||||
removable: true
|
removable: true
|
||||||
@ -458,7 +509,81 @@ components:
|
|||||||
- name: sqlite
|
- name: sqlite
|
||||||
removable: false
|
removable: false
|
||||||
version: 3.6*
|
version: 3.6*
|
||||||
|
pips:
|
||||||
|
- name: Paste
|
||||||
|
version: 1.7.5.1
|
||||||
|
- name: PasteDeploy
|
||||||
|
version: '1.5'
|
||||||
|
- name: PasteScript
|
||||||
|
version: 1.7.5
|
||||||
|
- name: Routes
|
||||||
|
version: 1.12.3
|
||||||
|
- name: SQLAlchemy
|
||||||
|
version: 0.7.5
|
||||||
|
- name: Tempita
|
||||||
|
options: --upgrade
|
||||||
|
version: 0.5dev
|
||||||
|
- name: iso8601
|
||||||
|
version: 0.1.4
|
||||||
|
- name: pycrypto
|
||||||
|
options: --upgrade
|
||||||
|
version: '2.5'
|
||||||
|
- name: sqlalchemy-migrate
|
||||||
|
version: 0.7.2
|
||||||
|
start: devstack.components.nova:NovaRuntime
|
||||||
|
stop: devstack.components.nova:NovaRuntime
|
||||||
|
subsystems:
|
||||||
|
api:
|
||||||
|
packages:
|
||||||
|
- name: python-dateutil
|
||||||
|
removable: false
|
||||||
|
version: 1.4*
|
||||||
|
cpu:
|
||||||
|
packages:
|
||||||
|
- name: iscsi-initiator-utils
|
||||||
|
removable: true
|
||||||
|
version: 6.2*
|
||||||
|
- name: libguestfs
|
||||||
|
removable: true
|
||||||
|
version: 1.2.7*
|
||||||
|
- name: libguestfs-mount
|
||||||
|
removable: true
|
||||||
|
version: 1.7.17*
|
||||||
|
- name: libguestfs-tools
|
||||||
|
removable: true
|
||||||
|
version: 1.7.17*
|
||||||
|
- name: libvirt
|
||||||
|
removable: true
|
||||||
|
version: 0.9.4*
|
||||||
|
- name: libvirt-client
|
||||||
|
removable: true
|
||||||
|
version: 0.9.4*
|
||||||
|
- name: libvirt-python
|
||||||
|
removable: true
|
||||||
|
version: 0.9.4*
|
||||||
|
- name: lvm2
|
||||||
|
removable: true
|
||||||
|
version: 2.02*
|
||||||
|
- name: qemu-img
|
||||||
|
removable: true
|
||||||
|
version: 0.12*
|
||||||
|
- name: qemu-kvm
|
||||||
|
removable: true
|
||||||
|
version: 2*
|
||||||
|
vol:
|
||||||
|
packages:
|
||||||
|
- name: iscsi-initiator-utils
|
||||||
|
removable: true
|
||||||
|
version: 6.2*
|
||||||
|
- name: lvm2
|
||||||
|
removable: true
|
||||||
|
version: 2.02*
|
||||||
|
- name: scsi-target-utils
|
||||||
|
removable: true
|
||||||
|
version: 1.0*
|
||||||
|
uninstall: devstack.components.nova:NovaUninstaller
|
||||||
nova-client:
|
nova-client:
|
||||||
|
install: devstack.components.nova_client:NovaClientInstaller
|
||||||
packages:
|
packages:
|
||||||
- meta:
|
- meta:
|
||||||
epel: true
|
epel: true
|
||||||
@ -470,7 +595,11 @@ components:
|
|||||||
name: python-prettytable
|
name: python-prettytable
|
||||||
removable: true
|
removable: true
|
||||||
version: 0.5*
|
version: 0.5*
|
||||||
|
start: devstack.components.nova_client:NovaClientRuntime
|
||||||
|
stop: devstack.components.nova_client:NovaClientRuntime
|
||||||
|
uninstall: devstack.components.nova_client:NovaClientUninstaller
|
||||||
quantum:
|
quantum:
|
||||||
|
install: devstack.components.quantum:QuantumInstaller
|
||||||
packages:
|
packages:
|
||||||
- name: libxml2-python
|
- name: libxml2-python
|
||||||
removable: false
|
removable: false
|
||||||
@ -490,16 +619,35 @@ components:
|
|||||||
name: python-greenlet
|
name: python-greenlet
|
||||||
removable: true
|
removable: true
|
||||||
version: 0.3.1*
|
version: 0.3.1*
|
||||||
|
pips:
|
||||||
|
- name: Paste
|
||||||
|
version: 1.7.5.1
|
||||||
|
- name: PasteDeploy
|
||||||
|
version: '1.5'
|
||||||
|
- name: PasteScript
|
||||||
|
version: 1.7.5
|
||||||
|
- name: Routes
|
||||||
|
version: 1.12.3
|
||||||
|
- name: SQLAlchemy
|
||||||
|
version: 0.7.5
|
||||||
|
- name: sqlalchemy-migrate
|
||||||
|
version: 0.7.2
|
||||||
|
start: devstack.components.quantum:QuantumRuntime
|
||||||
|
stop: devstack.components.quantum:QuantumRuntime
|
||||||
|
uninstall: devstack.components.quantum:QuantumUninstaller
|
||||||
quantum-client:
|
quantum-client:
|
||||||
|
install: devstack.components.quantum_client:QuantumClientInstaller
|
||||||
packages:
|
packages:
|
||||||
- meta:
|
- meta:
|
||||||
epel: true
|
epel: true
|
||||||
name: python-gflags
|
name: python-gflags
|
||||||
removable: true
|
removable: true
|
||||||
version: 1.4*
|
version: 1.4*
|
||||||
quantum-openvswitch:
|
start: devstack.components.quantum_client:QuantumClientRuntime
|
||||||
packages: null
|
stop: devstack.components.quantum_client:QuantumClientRuntime
|
||||||
rabbitmq:
|
uninstall: devstack.components.quantum_client:QuantumClientUninstaller
|
||||||
|
rabbit-mq:
|
||||||
|
install: devstack.components.rabbit:RabbitInstaller
|
||||||
packages:
|
packages:
|
||||||
- meta:
|
- meta:
|
||||||
epel: true
|
epel: true
|
||||||
@ -519,7 +667,13 @@ components:
|
|||||||
run_as_root: true
|
run_as_root: true
|
||||||
removable: true
|
removable: true
|
||||||
version: 2.6*
|
version: 2.6*
|
||||||
|
start: devstack.components.rabbit:RabbitRuntime
|
||||||
|
stop: devstack.components.rabbit:RabbitRuntime
|
||||||
|
uninstall: devstack.components.rabbit:RabbitUninstaller
|
||||||
swift:
|
swift:
|
||||||
packages: null
|
install: devstack.components.swift:SwiftInstaller
|
||||||
|
start: devstack.components.swift:SwiftRuntime
|
||||||
|
stop: devstack.components.swift:SwiftRuntime
|
||||||
|
uninstall: devstack.components.swift:SwiftUninstaller
|
||||||
...
|
...
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
name: ubuntu-oneiric
|
name: ubuntu-oneiric
|
||||||
distro_pattern: Ubuntu(.*)oneiric
|
distro_pattern: Ubuntu(.*)oneiric
|
||||||
|
|
||||||
packager_name: devstack.distros.oneiric:OneiricAptPackager
|
packager_name: devstack.distros.oneiric:AptPackager
|
||||||
|
|
||||||
commands:
|
commands:
|
||||||
|
|
||||||
|
@ -46,33 +46,33 @@ class DBInstaller(db.DBInstaller):
|
|||||||
sh.write_file('/etc/mysql/my.cnf', fc)
|
sh.write_file('/etc/mysql/my.cnf', fc)
|
||||||
|
|
||||||
|
|
||||||
class OneiricAptPackager(apt.AptPackager):
|
class AptPackager(apt.AptPackager):
|
||||||
|
|
||||||
def _pkg_remove_special(self, name, pkginfo):
|
def _remove_special(self, name, info):
|
||||||
if name == 'rabbitmq-server':
|
if name == 'rabbitmq-server':
|
||||||
#https://bugs.launchpad.net/ubuntu/+source/rabbitmq-server/+bug/878597
|
#https://bugs.launchpad.net/ubuntu/+source/rabbitmq-server/+bug/878597
|
||||||
#https://bugs.launchpad.net/ubuntu/+source/rabbitmq-server/+bug/878600
|
#https://bugs.launchpad.net/ubuntu/+source/rabbitmq-server/+bug/878600
|
||||||
LOG.info("Handling special remove of %s." % (name))
|
LOG.info("Handling special remove of %s." % (name))
|
||||||
pkg_full = self._format_pkg(name, pkginfo.get("version"))
|
pkg_full = self._format_pkg_name(name, info.get("version"))
|
||||||
cmd = apt.APT_GET + apt.APT_REMOVE + [pkg_full]
|
cmd = apt.APT_REMOVE + [pkg_full]
|
||||||
self._execute_apt(cmd)
|
self._execute_apt(cmd)
|
||||||
#probably useful to do this
|
#probably useful to do this
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
#purge
|
#purge
|
||||||
cmd = apt.APT_GET + apt.APT_PURGE + [pkg_full]
|
cmd = apt.APT_PURGE + [pkg_full]
|
||||||
self._execute_apt(cmd)
|
self._execute_apt(cmd)
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def _pkg_install_special(self, name, pkginfo):
|
def _install_special(self, name, info):
|
||||||
if name == 'rabbitmq-server':
|
if name == 'rabbitmq-server':
|
||||||
#https://bugs.launchpad.net/ubuntu/+source/rabbitmq-server/+bug/878597
|
#https://bugs.launchpad.net/ubuntu/+source/rabbitmq-server/+bug/878597
|
||||||
#https://bugs.launchpad.net/ubuntu/+source/rabbitmq-server/+bug/878600
|
#https://bugs.launchpad.net/ubuntu/+source/rabbitmq-server/+bug/878600
|
||||||
LOG.info("Handling special install of %s." % (name))
|
LOG.info("Handling special install of %s." % (name))
|
||||||
#this seems to be a temporary fix for that bug
|
#this seems to be a temporary fix for that bug
|
||||||
with tempfile.TemporaryFile() as f:
|
with tempfile.TemporaryFile() as f:
|
||||||
pkg_full = self._format_pkg(name, pkginfo.get("version"))
|
pkg_full = self._format_pkg_name(name, info.get("version"))
|
||||||
cmd = apt.APT_GET + apt.APT_INSTALL + [pkg_full]
|
cmd = apt.APT_INSTALL + [pkg_full]
|
||||||
self._execute_apt(cmd, stdout_fh=f, stderr_fh=f)
|
self._execute_apt(cmd, stdout_fh=f, stderr_fh=f)
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
@ -25,11 +25,25 @@ from devstack import utils
|
|||||||
from devstack.components import db
|
from devstack.components import db
|
||||||
from devstack.components import horizon
|
from devstack.components import horizon
|
||||||
|
|
||||||
|
from devstack.packaging import yum
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
SOCKET_CONF = "/etc/httpd/conf.d/wsgi-socket-prefix.conf"
|
SOCKET_CONF = "/etc/httpd/conf.d/wsgi-socket-prefix.conf"
|
||||||
HTTPD_CONF = '/etc/httpd/conf/httpd.conf'
|
HTTPD_CONF = '/etc/httpd/conf/httpd.conf'
|
||||||
|
|
||||||
|
# Need to relink for rhel (not a bug!)
|
||||||
|
RHEL_RELINKS = {
|
||||||
|
'python-webob1.0': {
|
||||||
|
"src": '/usr/lib/python2.6/site-packages/WebOb-1.0.8-py2.6.egg/webob/',
|
||||||
|
'tgt': '/usr/lib/python2.6/site-packages/webob',
|
||||||
|
},
|
||||||
|
'python-nose1.1': {
|
||||||
|
"src": '/usr/lib/python2.6/site-packages/nose-1.1.2-py2.6.egg/nose/',
|
||||||
|
'tgt': '/usr/lib/python2.6/site-packages/nose',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
class DBInstaller(db.DBInstaller):
|
class DBInstaller(db.DBInstaller):
|
||||||
|
|
||||||
@ -47,12 +61,12 @@ class DBInstaller(db.DBInstaller):
|
|||||||
sh.write_file('/etc/my.cnf', fc)
|
sh.write_file('/etc/my.cnf', fc)
|
||||||
|
|
||||||
|
|
||||||
class Rhel6HorizonInstaller(horizon.HorizonInstaller):
|
class HorizonInstaller(horizon.HorizonInstaller):
|
||||||
|
|
||||||
def _config_fixups(self):
|
def _config_fixups(self):
|
||||||
(user, group) = self._get_apache_user_group()
|
(user, group) = self._get_apache_user_group()
|
||||||
|
# This is recorded so it gets cleaned up during uninstall
|
||||||
self.tracewriter.file_touched(SOCKET_CONF)
|
self.tracewriter.file_touched(SOCKET_CONF)
|
||||||
# Not recorded since we aren't really creating this
|
|
||||||
LOG.info("Fixing up %s and %s files" % (SOCKET_CONF, HTTPD_CONF))
|
LOG.info("Fixing up %s and %s files" % (SOCKET_CONF, HTTPD_CONF))
|
||||||
with sh.Rooted(True):
|
with sh.Rooted(True):
|
||||||
# Fix the socket prefix to someplace we can use
|
# Fix the socket prefix to someplace we can use
|
||||||
@ -67,3 +81,29 @@ class Rhel6HorizonInstaller(horizon.HorizonInstaller):
|
|||||||
line = "Group %s" % (group)
|
line = "Group %s" % (group)
|
||||||
new_lines.append(line)
|
new_lines.append(line)
|
||||||
sh.write_file(HTTPD_CONF, utils.joinlinesep(*new_lines))
|
sh.write_file(HTTPD_CONF, utils.joinlinesep(*new_lines))
|
||||||
|
|
||||||
|
|
||||||
|
class YumPackager(yum.YumPackager):
|
||||||
|
|
||||||
|
def _remove_special(self, name, info):
|
||||||
|
if name in RHEL_RELINKS:
|
||||||
|
# Note: we don't return true here so that
|
||||||
|
# the normal package cleanup happens...
|
||||||
|
sh.unlink(RHEL_RELINKS.get(name).get("tgt"))
|
||||||
|
return False
|
||||||
|
|
||||||
|
def _install_special(self, name, info):
|
||||||
|
if name in RHEL_RELINKS:
|
||||||
|
full_pkg_name = self._format_pkg_name(name, info.get("version"))
|
||||||
|
install_cmd = yum.YUM_INSTALL + [full_pkg_name]
|
||||||
|
self._execute_yum(install_cmd)
|
||||||
|
tgt = RHEL_RELINKS.get(pkgname).get("tgt")
|
||||||
|
src = RHEL_RELINKS.get(pkgname).get("src")
|
||||||
|
if not sh.islink(tgt):
|
||||||
|
# This is actually a feature, EPEL must not conflict with RHEL, so X pkg installs newer version in parallel.
|
||||||
|
#
|
||||||
|
# This of course doesn't work when running from git like devstack does....
|
||||||
|
sh.symlink(src, tgt)
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
@ -44,15 +44,15 @@ class AptPackager(pack.Packager):
|
|||||||
pack.Packager.__init__(self, distro, keep_packages)
|
pack.Packager.__init__(self, distro, keep_packages)
|
||||||
self.auto_remove = True
|
self.auto_remove = True
|
||||||
|
|
||||||
def _format_pkg(self, name, version):
|
def _format_pkg_name(self, name, version):
|
||||||
if version:
|
if version:
|
||||||
pkg_full_name = VERSION_TEMPL % (name, version)
|
return VERSION_TEMPL % (name, version)
|
||||||
else:
|
else:
|
||||||
pkg_full_name = name
|
return name
|
||||||
return pkg_full_name
|
|
||||||
|
|
||||||
def _execute_apt(self, cmd, **kargs):
|
def _execute_apt(self, cmd, **kargs):
|
||||||
return sh.execute(*cmd, run_as_root=True,
|
full_cmd = APT_GET + cmd
|
||||||
|
return sh.execute(*full_cmd, run_as_root=True,
|
||||||
check_exit_code=True,
|
check_exit_code=True,
|
||||||
env_overrides=ENV_ADDITIONS,
|
env_overrides=ENV_ADDITIONS,
|
||||||
**kargs)
|
**kargs)
|
||||||
@ -65,32 +65,33 @@ class AptPackager(pack.Packager):
|
|||||||
removable = info.get('removable', True)
|
removable = info.get('removable', True)
|
||||||
if not removable:
|
if not removable:
|
||||||
continue
|
continue
|
||||||
if self._pkg_remove_special(name, info):
|
if self._remove_special(name, info):
|
||||||
which_removed.append(name)
|
which_removed.append(name)
|
||||||
continue
|
continue
|
||||||
pkg_full = self._format_pkg(name, info.get("version"))
|
pkg_full = self._format_pkg_name(name, info.get("version"))
|
||||||
if pkg_full:
|
if pkg_full:
|
||||||
cmds.append(pkg_full)
|
cmds.append(pkg_full)
|
||||||
which_removed.append(name)
|
which_removed.append(name)
|
||||||
if cmds:
|
if cmds:
|
||||||
cmd = APT_GET + APT_DO_REMOVE + cmds
|
cmd = APT_DO_REMOVE + cmds
|
||||||
self._execute_apt(cmd)
|
self._execute_apt(cmd)
|
||||||
if which_removed and self.auto_remove:
|
if which_removed and self.auto_remove:
|
||||||
cmd = APT_GET + APT_AUTOREMOVE
|
cmd = APT_AUTOREMOVE
|
||||||
self._execute_apt(cmd)
|
self._execute_apt(cmd)
|
||||||
return which_removed
|
return which_removed
|
||||||
|
|
||||||
def install(self, pkg):
|
def install(self, pkg):
|
||||||
name = pkg['name']
|
name = pkg['name']
|
||||||
if self._pkg_install_special(name, pkg):
|
if self._install_special(name, pkg):
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
pkg_full = self._format_pkg(name, pkg.get("version"))
|
pkg_full = self._format_pkg_name(name, pkg.get("version"))
|
||||||
cmd = APT_GET + APT_INSTALL + [pkg_full]
|
if pkg_full:
|
||||||
self._execute_apt(cmd)
|
cmd = APT_INSTALL + [pkg_full]
|
||||||
|
self._execute_apt(cmd)
|
||||||
|
|
||||||
def _pkg_remove_special(self, name, info):
|
def _remove_special(self, name, info):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def _pkg_install_special(self, name, info):
|
def _install_special(self, name, info):
|
||||||
return False
|
return False
|
||||||
|
@ -30,74 +30,36 @@ YUM_REMOVE = ['erase', '-y', "-t"]
|
|||||||
# Yum separates its pkg names and versions with a dash
|
# Yum separates its pkg names and versions with a dash
|
||||||
VERSION_TEMPL = "%s-%s"
|
VERSION_TEMPL = "%s-%s"
|
||||||
|
|
||||||
# Need to relink for rhel (not a bug!)
|
|
||||||
# TODO: maybe this should be a subclass that handles these differences
|
|
||||||
RHEL_RELINKS = {
|
|
||||||
'python-webob1.0': {
|
|
||||||
"src": '/usr/lib/python2.6/site-packages/WebOb-1.0.8-py2.6.egg/webob/',
|
|
||||||
'tgt': '/usr/lib/python2.6/site-packages/webob',
|
|
||||||
},
|
|
||||||
'python-nose1.1': {
|
|
||||||
"src": '/usr/lib/python2.6/site-packages/nose-1.1.2-py2.6.egg/nose/',
|
|
||||||
'tgt': '/usr/lib/python2.6/site-packages/nose',
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
class YumPackager(pack.Packager):
|
class YumPackager(pack.Packager):
|
||||||
def __init__(self, distro, keep_packages):
|
def __init__(self, distro, keep_packages):
|
||||||
pack.Packager.__init__(self, distro, keep_packages)
|
pack.Packager.__init__(self, distro, keep_packages)
|
||||||
|
|
||||||
def _format_pkg_name(self, name, version):
|
def _format_pkg_name(self, name, version):
|
||||||
if version is not None and len(version):
|
if version:
|
||||||
return VERSION_TEMPL % (name, version)
|
return VERSION_TEMPL % (name, version)
|
||||||
else:
|
else:
|
||||||
return name
|
return name
|
||||||
|
|
||||||
def _execute_yum(self, cmd, **kargs):
|
def _execute_yum(self, cmd, **kargs):
|
||||||
return sh.execute(*cmd, run_as_root=True,
|
full_cmd = YUM_CMD + cmd
|
||||||
|
return sh.execute(*full_cmd, run_as_root=True,
|
||||||
check_exit_code=True,
|
check_exit_code=True,
|
||||||
**kargs)
|
**kargs)
|
||||||
|
|
||||||
def _remove_special(self, pkgname, pkginfo):
|
def _remove_special(self, name, info):
|
||||||
# TODO: maybe this should be a subclass that handles these differences
|
|
||||||
# if self.distro.name == settings.RHEL6 and pkgname in RHEL_RELINKS:
|
|
||||||
# #we don't return true here so that
|
|
||||||
# #the normal package cleanup happens
|
|
||||||
# sh.unlink(RHEL_RELINKS.get(pkgname).get("tgt"))
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# TODO: maybe this should be a subclass that handles these differences
|
def _install_special(self, name, info):
|
||||||
def _install_rhel_relinks(self, pkgname, pkginfo):
|
|
||||||
full_pkg_name = self._format_pkg_name(pkgname, pkginfo.get("version"))
|
|
||||||
install_cmd = YUM_CMD + YUM_INSTALL + [full_pkg_name]
|
|
||||||
self._execute_yum(install_cmd)
|
|
||||||
tgt = RHEL_RELINKS.get(pkgname).get("tgt")
|
|
||||||
src = RHEL_RELINKS.get(pkgname).get("src")
|
|
||||||
if not sh.islink(tgt):
|
|
||||||
# This is actually a feature, EPEL must not conflict with RHEL, so X pkg installs newer version in parallel.
|
|
||||||
#
|
|
||||||
# This of course doesn't work when running from git like devstack does....
|
|
||||||
sh.symlink(src, tgt)
|
|
||||||
return True
|
|
||||||
|
|
||||||
# TODO: maybe this should be a subclass that handles these differences
|
|
||||||
def _install_special(self, pkgname, pkginfo):
|
|
||||||
# FIXME:
|
|
||||||
# if self.distro.name == settings.RHEL6 and pkgname in RHEL_RELINKS:
|
|
||||||
# return self._install_rhel_relinks(pkgname, pkginfo)
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def install_batch(self, pkgs):
|
def install(self, pkg):
|
||||||
pkg_full_names = []
|
name = pkg['name']
|
||||||
for info in pkgs:
|
if self._install_special(name, pkg):
|
||||||
name = info['name']
|
return
|
||||||
if self._install_special(name, info):
|
else:
|
||||||
continue
|
full_pkg_name = self._format_pkg_name(name, pkg.get("version"))
|
||||||
full_pkg_name = self._format_pkg_name(name, info.get("version"))
|
cmd = YUM_INSTALL + [full_pkg_name]
|
||||||
pkg_full_names.append(full_pkg_name)
|
|
||||||
if pkg_full_names:
|
|
||||||
cmd = YUM_CMD + YUM_INSTALL + pkg_full_names
|
|
||||||
self._execute_yum(cmd)
|
self._execute_yum(cmd)
|
||||||
|
|
||||||
def _remove_batch(self, pkgs):
|
def _remove_batch(self, pkgs):
|
||||||
@ -111,11 +73,11 @@ class YumPackager(pack.Packager):
|
|||||||
continue
|
continue
|
||||||
if self._remove_special(name, info):
|
if self._remove_special(name, info):
|
||||||
which_removed.append(name)
|
which_removed.append(name)
|
||||||
continue
|
else:
|
||||||
full_pkg_name = self._format_pkg_name(name, info.get("version"))
|
full_pkg_name = self._format_pkg_name(name, info.get("version"))
|
||||||
pkg_full_names.append(full_pkg_name)
|
pkg_full_names.append(full_pkg_name)
|
||||||
which_removed.append(name)
|
which_removed.append(name)
|
||||||
if pkg_full_names:
|
if pkg_full_names:
|
||||||
cmd = YUM_CMD + YUM_REMOVE + pkg_full_names
|
cmd = YUM_REMOVE + pkg_full_names
|
||||||
self._execute_yum(cmd)
|
self._execute_yum(cmd)
|
||||||
return which_removed
|
return which_removed
|
||||||
|
@ -79,9 +79,9 @@ class Persona(object):
|
|||||||
# Some sanity checks against the given distro
|
# Some sanity checks against the given distro
|
||||||
d_name = distro.name
|
d_name = distro.name
|
||||||
if d_name not in self.distro_support:
|
if d_name not in self.distro_support:
|
||||||
msg = "Distro %s not supported" % (d_name)
|
msg = "Distro %r not supported" % (d_name)
|
||||||
raise excp.ConfigException(msg)
|
raise excp.ConfigException(msg)
|
||||||
for c in self.wanted_components:
|
for c in self.wanted_components:
|
||||||
if not distro.known_component(c):
|
if not distro.known_component(c):
|
||||||
raise RuntimeError("Distro %s does not support component %s" %
|
raise RuntimeError("Distro %r does not support component %r" %
|
||||||
(d_name, c))
|
(d_name, c))
|
||||||
|
6
stack
6
stack
@ -166,9 +166,9 @@ def run(args):
|
|||||||
pkg_manager,
|
pkg_manager,
|
||||||
**args)
|
**args)
|
||||||
|
|
||||||
LOG.info("Starting action [%s] on %s for distro: %s" % (action, date.rcf8222date(), dist.name))
|
LOG.info("Starting action %r on %s for distro: %r" % (action, date.rcf8222date(), dist.name))
|
||||||
LOG.info("Using persona: %s" % (persona_inst))
|
LOG.info("Using persona: %r" % (persona_fn))
|
||||||
LOG.info("In root directory: %s" % (root_dir))
|
LOG.info("In root directory: %r" % (root_dir))
|
||||||
|
|
||||||
start_time = time.time()
|
start_time = time.time()
|
||||||
runner.run(persona_inst, root_dir)
|
runner.run(persona_inst, root_dir)
|
||||||
|
@ -7,6 +7,6 @@ import sys
|
|||||||
|
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
with open(sys.argv[1], 'r') as f:
|
with open(sys.argv[1], 'r') as f:
|
||||||
yaml.load(f)
|
yaml.load(f)
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import yaml
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
import yaml
|
||||||
|
|
||||||
# See: http://pyyaml.org/wiki/PyYAMLDocumentation
|
# See: http://pyyaml.org/wiki/PyYAMLDocumentation
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
Loading…
Reference in New Issue
Block a user