Validate user_data_format for server with deployment

Validation error will be raised if user_data_format is not set
correctly.

Partial-Bug: #1295536
Change-Id: I0509c9c3a71d09fa8e2113710d561ffd3289d814
Fix validate failed with an image_name in uuid format

We should support to get the image_id by an image_name which is in uuid
format.

Change-Id: I471ee57ea55f990f852398a43762899dbc3d8692
Closes-Bug: #1312523
Add a Nova Flavor resource.

This will allow using more fine-grained specification of computational
resources (RAM, CPU, disk, etc.).

A nova flavor resource has the following format:

  heat_template_version: 2013-05-23
  description:  Heat Flavor creation example
    resources:
      test_flavor:
        type: OS::Nova::Flavor
        properties:
          ram: 1024
          vcpus: 1
          disk: 20
          swap: 2

Change-Id: I79812f0ef0d0dc616ccb3361e9b5864faa877df1
Implements: blueprint dynamic-flavors
Deprecate Stack.resolve_runtime_data()

This no longer needs to be done in the context of a stack, because all of
the required context is embedded in the lazily-evaluated functions at the
time they are parsed into Functions. Reduce confusion by eliminating all
uses of it and marking it as deprecated.

Change-Id: I9d89b5201df5b05d03a295eaf6605da65397f565
Do not initialise stack_user password

Since Server implements this property with @property decorators,
setting password to None has the side-effect of writing None to
the resource data.

This change fetches the password with getattr instead.

Change-Id: I1107ee9710ec8520d7231c5b8b711e21b4183a34
Include exception in custom constraints errors

This refactors constraints to use a shared base class that includes the
error message when validation errors happen.

Co-Authored-By: ala.rezmerita@cloudwatt.com
Closes-Bug: #1297371
Change-Id: Ia382f53d85d83c8c474ad8bda93c6d65f16cfca9
Add ISO 8601 date constraint

Add a constraint to validate that dates are expressed in the format
described by ISO 8601.

Implements: blueprint iso8601-constraint
Change-Id: I1a7e5b75eab94dc78399347517217221c6ad475c
Make Server CONFIG_DRIVE property a boolean

There's no reason for CONFIG_DRIVE to be a string.  It only accepts a
boolean.

Related change in python-novaclient:
https://review.openstack.org/#/c/91169

Change-Id: I2ff588537fbe72fefed0163b69e68c4f484a38e7
SoftwareDeployments tolerate string zero status code

When evaluating the status code, we treat 0 as OK, but '0' as
a failure, which is inconvenient when returning the status via
shell scripts, so tolerate either format.

Change-Id: Iddac03e38ae87b1103757531ee0247929f9584ac
Merge "Add ISO 8601 date constraint"
Ignore nova limits set to '-1'

In case nova server has quotas turned off, e.g. when it uses
NoopQuotaDriver, nova-api returns '-1' for corresponding resources which
obviously means 'INFINITY'. In this case we should not check resource
template for any limits and should pass resource creation as-is.

Change-Id: Idaf485719e384f3a613031c7ff272d55798e6e77
Closes-Bug: #1310710
Co-Authored-By: Dmitry Borodaenko <dborodaenko@mirantis.com>
Merge "Add a Nova Flavor resource."
Merge "Fix validate failed with an image_name in uuid format"
Merge "SoftwareDeployments tolerate string zero status code"
Update common docstrings to match guidelines

Per http://docs.openstack.org/developer/hacking/
and http://www.python.org/dev/peps/pep-0257/

Without extra blank line in multi-line docstrings
based on http://lists.openstack.org/pipermail/openstack-dev/2014-February/028156.html

Blueprint: reduce-flake8-ignored-rules

Change-Id: Ic970fff3b66c357170f45e817d080fdb37c63d6e
Merge "Ignore nova limits set to '-1'"
Merge "Update common docstrings to match guidelines"
Merge "Include exception in custom constraints errors"
Merge "Make Server CONFIG_DRIVE property a boolean"
Merge "Validate user_data_format for server with deployment"