Openstack热环境参数文件默认值无效错误

问题描述 投票:0回答:1

我正在尝试使用模板文件和环境参数文件创建堆栈。以下是我的详细信息。

在模板文件中:

v6_ip:
  type: string
  description: ipv6 address
  constraints:
    - length: { min: 1, max: 46 }
  default: 0

v6_prefix_len:
  type: number
  description: ipv6 prefix length
  constraints:
    - range: { min: 0, max: 128 }
  default: 0

v6_gateway:
  type: string
  description: ipv6 default gateway
  constraints:
    - length: { min: 1, max: 46 }
  default: 0

server:
    type: OS::Nova::Server
    properties:
      name: { get_param : my_name }
      metadata:
      config_drive: True
      user_data:
        params:      
          $IPV4: { get_param: v4_ip }
          $V4_NETMASK: { get_param: v4_netmask }
          $V4_GW: { get_param: v4_gateway }
          $IPV6: { get_param: v6_ip }
          $V6_PREFIX: { get_param: v6_prefix_len }
          $V6_GW: { get_param: v6_gateway }

环境文件:

v4_ip: 192.168.11.179
v4_netmask: 255.255.240.0
v4_gateway: 192.168.0.254
v6_ip: fd5d:d50a:8c17:2110::2019
v6_prefix_len: 64
v6_gateway: fd5d:d50a:8c17:2110::ff

当我尝试创建堆栈时,我收到以下错误:

错误:参数'v6_gateway'无效:无效默认值0(类型'int'的对象没有len())

我已经将v6_gateway定义为字符串,默认值为0.对于v4_gateway来说,它接受了同样的事情。为什么它会给v6_gateway抛出错误?还有怎么解决呢?

PS:我正在使用openstack牛顿版。

openstack openstack-heat
1个回答
1
投票

问题是您的默认网关是一个数字,而不是一个字符串。如果你确实需要默认的0有效,你可以用撇号包装它。

v6_gateway:
  type: string
  description: ipv6 default gateway
  constraints:
    - length: { min: 1, max: 46 }
  default: '0'
© www.soinside.com 2019 - 2024. All rights reserved.