~ubuntu-branches/ubuntu/wily/heat/wily-proposed

« back to all changes in this revision

Viewing changes to heat/engine/resources/openstack/heat/instance_group.py

  • Committer: Package Import Robot
  • Author(s): Corey Bryant, Corey Bryant, James Page
  • Date: 2015-07-07 17:06:19 UTC
  • mfrom: (1.1.26) (45.1.1 vivid-proposed)
  • Revision ID: package-import@ubuntu.com-20150707170619-hra2dbjpfofpou4s
Tags: 1:5.0.0~b1-0ubuntu1
[ Corey Bryant ]
* New upstream milestone for OpenStack Liberty:
  - d/control: Align (build-)depends with upstream.
  - d/p/fix-requirements.patch: Rebased.
  - d/p/sudoers_patch.patch: Rebased.

[ James Page ]
* d/s/options: Ignore any removal of egg-info data during package clean.
* d/control: Drop MySQL and PostgreSQL related BD's, not required for unit
  testing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
103
103
    attributes_schema = {
104
104
        INSTANCE_LIST: attributes.Schema(
105
105
            _("A comma-delimited list of server ip addresses. "
106
 
              "(Heat extension).")
 
106
              "(Heat extension)."),
 
107
            type=attributes.Schema.STRING
107
108
        ),
108
109
    }
109
110
    rolling_update_schema = {
110
 
        MIN_INSTANCES_IN_SERVICE: properties.Schema(properties.Schema.NUMBER,
 
111
        MIN_INSTANCES_IN_SERVICE: properties.Schema(properties.Schema.INTEGER,
111
112
                                                    default=0),
112
 
        MAX_BATCH_SIZE: properties.Schema(properties.Schema.NUMBER,
 
113
        MAX_BATCH_SIZE: properties.Schema(properties.Schema.INTEGER,
113
114
                                          default=1),
114
115
        PAUSE_TIME: properties.Schema(properties.Schema.STRING,
115
116
                                      default='PT0S')
135
136
        """
136
137
        super(InstanceGroup, self).validate()
137
138
 
138
 
        if self.update_policy:
 
139
        if self.update_policy is not None:
139
140
            self.update_policy.validate()
140
 
            policy_name = self.update_policy_schema.keys()[0]
141
 
            if self.update_policy[policy_name]:
 
141
            policy_name = self.ROLLING_UPDATE
 
142
            if (policy_name in self.update_policy and
 
143
                    self.update_policy[policy_name] is not None):
142
144
                pause_time = self.update_policy[policy_name][self.PAUSE_TIME]
143
145
                if iso8601utils.parse_isoduration(pause_time) > 3600:
144
146
                    msg = _('Maximum %s is 1 hour.') % self.PAUSE_TIME