~ubuntu-branches/ubuntu/utopic/heat/utopic-proposed

« back to all changes in this revision

Viewing changes to heat/engine/stack.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Corey Bryant
  • Date: 2015-02-09 15:12:41 UTC
  • mfrom: (1.1.22)
  • Revision ID: package-import@ubuntu.com-20150209151241-e62zx02m846zet2r
Tags: 2014.2.2-0ubuntu1
[ Corey Bryant ]
* Resynchronize with stable/juno (423ee27) (LP: #1418695):
  - [b52c916] Convert bool/int values into string for string properties
  - [65294f4] Check that template format plugins are registered
  - [94dec9e] Disable nested validation for ResourceGroup with zero count
  - [c5346cd] Remove mocking of timeutils.utcnow
  - [d8abdfd] Always update nested stacks
  - [edf0198] ResourceGroup allow update of resource_def
  - [aabd3d8] Add Dimensions Default in AWS_CloudWatch_Alarm.yaml
  - [bbf7182] Fix error msg invalid stack or res name
  - [423ee27] Use kwargs for ResourcePropertyConflict exception
* d/p/fix-requirements.patch: Rebased.
* d/control: Bump minimum python-eventlet to get socket_timeout support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
82
82
        stack is already in the database.
83
83
        '''
84
84
 
 
85
        def _validate_stack_name(name):
 
86
            if not re.match("[a-zA-Z][a-zA-Z0-9_.-]*$", name):
 
87
                message = _('Invalid stack name %s must contain '
 
88
                            'only alphanumeric or \"_-.\" characters, '
 
89
                            'must start with alpha') % name
 
90
                raise exception.StackValidationFailed(message=message)
 
91
 
85
92
        if owner_id is None:
86
 
            if re.match("[a-zA-Z][a-zA-Z0-9_.-]*$", stack_name) is None:
87
 
                raise ValueError(_('Invalid stack name %s'
88
 
                                   ' must contain only alphanumeric or '
89
 
                                   '\"_-.\" characters, must start with alpha'
90
 
                                   ) % stack_name)
 
93
            _validate_stack_name(stack_name)
91
94
 
92
95
        self.id = stack_id
93
96
        self.owner_id = owner_id