PDO 安装 openstack rocky 报错 'ascii' codec can't encode characters in position 8-9: ordinal not in rang

 

Error: Failed to apply catalog: Execution of '/usr/bin/openstack project list --quiet --format csv --long' returned 1: 'ascii' codec can't encode characters in position 8-9: ordinal not in range(128)
You will find full trace in log /var/tmp/packstack/20181111-105444-_ACQdo/manifests/192.168.240.234_controller.pp.log

cd /usr/lib/python2.7/site-packages/

修改(如果不存在就创建一个)
cat <<EOF > sitecustomize.py 
# encoding=utf8
import sys
reload(sys)
sys.setdefaultencoding('utf8')
EOF

再运行安装就行了。

#!/bin/bash
chkconfig NetworkManager off
chkconfig firewalld off
service NetworkManager stop
setenforce 0
service firewalld stop
sed -i 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/selinux/config
sed   -e "s/^metalink=/#metalink=/g" \
        -e "s/^mirrorlist=http/#mirrorlist=http/g" \
        -e "s@^#baseurl=@baseurl=@g" \
        -i   /etc/yum.repos.d/*.repo
cat <<EOF >>/etc/hosts
192.168.239.241 mirror.centos.org
EOF
yum update -y
#yum reinstall https://rdoproject.org/repos/rdo-release.rpm -y
wget https://repos.fedorapeople.org/repos/openstack/openstack-rocky/rdo-release-rocky-0.noarch.rpm
yum localinstall -y rdo-release-rocky-0.noarch.rpm
yum reinstall centos-release-openstack-rocky -y
yum reinstall openstack-packstack -y
yum install ansible -y
pvcreate /dev/sdb 
vgcreate cinder-volumes /dev/sdb

#packstack --default-password=123456 --gen-answer-file answers.txt
cat <<EOF >/root/answers.yml 
- hosts: localhost
  tasks:
#  - lineinfile:
#     path: answers.txt
#     regexp: "^CONFIG_KEYSTONE_ADMIN_PW"
#     line: "CONFIG_KEYSTONE_ADMIN_PW=gtland2019"
  - lineinfile:
     path: answers.txt
     regexp: "^CONFIG_CINDER_VOLUMES_CREATE"
     line: "CONFIG_CINDER_VOLUMES_CREATE=n"
  - lineinfile:
     path: answers.txt
     regexp: "^CONFIG_NEUTRON_ML2_VNI_RANGES="
     line: "CONFIG_NEUTRON_ML2_VNI_RANGES=10:1000"
  - lineinfile:
     path: answers.txt
     regexp: "^CONFIG_NEUTRON_OVS_BRIDGE_MAPPINGS"
     line: "CONFIG_NEUTRON_OVS_BRIDGE_MAPPINGS=extnet:br-ex"
  - lineinfile:
     path: answers.txt
     regexp: "^CONFIG_NEUTRON_OVS_BRIDGE_IFACES"
     line: "CONFIG_NEUTRON_OVS_BRIDGE_IFACES=br-ex:eno3"

  - lineinfile:
     path: answers.txt
     regexp: "^CONFIG_COMPUTE_HOSTS"
     line: "CONFIG_COMPUTE_HOSTS=192.168.240.234,192.168.240.233,192.168.240.232"
EOF

ansible-playbook /root/answers.yml

packstack --answer-file=/root/answers.txt
#reboot
#cd /usr/lib/python2.7/site-packages/
cat <<EOF > sitecustomize.py 
# encoding=utf8
import sys
reload(sys)
sys.setdefaultencoding('utf8')
EOF

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值