Merge pull request #6918 from jtopjian/openstack-devstack-fmt-fixes
provider/openstack: Devstack and fmt fixes
This commit is contained in:
commit
709e0bf9ad
|
@ -116,10 +116,12 @@ wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img
|
||||||
glance image-create --name CirrOS --disk-format qcow2 --container-format bare < cirros-0.3.4-x86_64-disk.img
|
glance image-create --name CirrOS --disk-format qcow2 --container-format bare < cirros-0.3.4-x86_64-disk.img
|
||||||
nova flavor-create m1.tform 99 512 5 1 --ephemeral 10
|
nova flavor-create m1.tform 99 512 5 1 --ephemeral 10
|
||||||
_NETWORK_ID=$(nova net-list | grep private | awk -F\| '{print $2}' | tr -d ' ')
|
_NETWORK_ID=$(nova net-list | grep private | awk -F\| '{print $2}' | tr -d ' ')
|
||||||
|
_EXTGW_ID=$(nova net-list | grep public | awk -F\| '{print $2}' | tr -d ' ')
|
||||||
_IMAGE_ID=$(nova image-list | grep CirrOS | awk -F\| '{print $2}' | tr -d ' ' | head -1)
|
_IMAGE_ID=$(nova image-list | grep CirrOS | awk -F\| '{print $2}' | tr -d ' ' | head -1)
|
||||||
echo export OS_IMAGE_NAME="cirros-0.3.4-x86_64-uec" >> openrc
|
echo export OS_IMAGE_NAME="cirros-0.3.4-x86_64-uec" >> openrc
|
||||||
echo export OS_IMAGE_ID="$_IMAGE_ID" >> openrc
|
echo export OS_IMAGE_ID="$_IMAGE_ID" >> openrc
|
||||||
echo export OS_NETWORK_ID=$_NETWORK_ID >> openrc
|
echo export OS_NETWORK_ID=$_NETWORK_ID >> openrc
|
||||||
|
echo export OS_EXTGW_ID=$_EXTGW_ID >> openrc
|
||||||
echo export OS_POOL_NAME="public" >> openrc
|
echo export OS_POOL_NAME="public" >> openrc
|
||||||
echo export OS_FLAVOR_ID=99 >> openrc
|
echo export OS_FLAVOR_ID=99 >> openrc
|
||||||
source openrc demo
|
source openrc demo
|
||||||
|
|
|
@ -69,45 +69,45 @@ func TestAccNetworkingV2FloatingIP_fixedip_bind(t *testing.T) {
|
||||||
var fip floatingips.FloatingIP
|
var fip floatingips.FloatingIP
|
||||||
var testAccNetworkingV2FloatingIP_fixedip_bind = fmt.Sprintf(`
|
var testAccNetworkingV2FloatingIP_fixedip_bind = fmt.Sprintf(`
|
||||||
resource "openstack_networking_network_v2" "network_1" {
|
resource "openstack_networking_network_v2" "network_1" {
|
||||||
name = "network_1"
|
name = "network_1"
|
||||||
admin_state_up = "true"
|
admin_state_up = "true"
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "openstack_networking_subnet_v2" "subnet_1" {
|
resource "openstack_networking_subnet_v2" "subnet_1" {
|
||||||
name = "subnet_1"
|
name = "subnet_1"
|
||||||
network_id = "${openstack_networking_network_v2.network_1.id}"
|
network_id = "${openstack_networking_network_v2.network_1.id}"
|
||||||
cidr = "192.168.199.0/24"
|
cidr = "192.168.199.0/24"
|
||||||
ip_version = 4
|
ip_version = 4
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "openstack_networking_router_interface_v2" "router_interface_1" {
|
resource "openstack_networking_router_interface_v2" "router_interface_1" {
|
||||||
router_id = "${openstack_networking_router_v2.router_1.id}"
|
router_id = "${openstack_networking_router_v2.router_1.id}"
|
||||||
subnet_id = "${openstack_networking_subnet_v2.subnet_1.id}"
|
subnet_id = "${openstack_networking_subnet_v2.subnet_1.id}"
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "openstack_networking_router_v2" "router_1" {
|
resource "openstack_networking_router_v2" "router_1" {
|
||||||
name = "router_1"
|
name = "router_1"
|
||||||
external_gateway = "%s"
|
external_gateway = "%s"
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "openstack_networking_port_v2" "port_1" {
|
resource "openstack_networking_port_v2" "port_1" {
|
||||||
network_id = "${openstack_networking_subnet_v2.subnet_1.network_id}"
|
network_id = "${openstack_networking_subnet_v2.subnet_1.network_id}"
|
||||||
admin_state_up = "true"
|
admin_state_up = "true"
|
||||||
fixed_ip {
|
fixed_ip {
|
||||||
subnet_id = "${openstack_networking_subnet_v2.subnet_1.id}"
|
subnet_id = "${openstack_networking_subnet_v2.subnet_1.id}"
|
||||||
ip_address = "192.168.199.10"
|
ip_address = "192.168.199.10"
|
||||||
}
|
}
|
||||||
fixed_ip {
|
fixed_ip {
|
||||||
subnet_id = "${openstack_networking_subnet_v2.subnet_1.id}"
|
subnet_id = "${openstack_networking_subnet_v2.subnet_1.id}"
|
||||||
ip_address = "192.168.199.20"
|
ip_address = "192.168.199.20"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "openstack_networking_floatingip_v2" "ip_1" {
|
resource "openstack_networking_floatingip_v2" "ip_1" {
|
||||||
pool = "%s"
|
pool = "%s"
|
||||||
port_id = "${openstack_networking_port_v2.port_1.id}"
|
port_id = "${openstack_networking_port_v2.port_1.id}"
|
||||||
fixed_ip = "${openstack_networking_port_v2.port_1.fixed_ip.1.ip_address}"
|
fixed_ip = "${openstack_networking_port_v2.port_1.fixed_ip.1.ip_address}"
|
||||||
}`,
|
}`,
|
||||||
os.Getenv("OS_EXTGW_ID"), os.Getenv("OS_POOL_NAME"))
|
os.Getenv("OS_EXTGW_ID"), os.Getenv("OS_POOL_NAME"))
|
||||||
|
|
||||||
resource.Test(t, resource.TestCase{
|
resource.Test(t, resource.TestCase{
|
||||||
|
|
Loading…
Reference in New Issue