
from openstack import service_filter


class DatabaseService(service_filter.ServiceFilter):
    """The database service."""

    valid_versions = [service_filter.ValidVersion('v1', path='v1.0')]

    def __init__(self, version=None):
        """Create a database service."""

        super(DatabaseService, self).__init__(service_type="rax:database",
                                              service_name="cloudDatabases",
                                              version=version)


from openstack import service_filter


class DatabaseService(service_filter.ServiceFilter):
    """The database service."""

    valid_versions = [service_filter.ValidVersion('v1', path='v1.0')]

    def __init__(self, version=None):
        """Create a database service."""

        if not version:
            version = "v1"

        super(DatabaseService, self).__init__(service_type="rax:database",
                                              service_name="cloudDatabases",
                                              version=version)

Set default version for cloud databases.
Set default version for cloud databases.

  
  from openstack import service_filter
  
  
  class DatabaseService(service_filter.ServiceFilter):
      """The database service."""
  
      valid_versions = [service_filter.ValidVersion('v1', path='v1.0')]
  
      def __init__(self, version=None):
          """Create a database service."""
  
+         if not version:
+             version = "v1"
+ 
          super(DatabaseService, self).__init__(service_type="rax:database",
                                                service_name="cloudDatabases",
                                                version=version)
  
Set default version for cloud databases.
## Code Before:

from openstack import service_filter


class DatabaseService(service_filter.ServiceFilter):
    """The database service."""

    valid_versions = [service_filter.ValidVersion('v1', path='v1.0')]

    def __init__(self, version=None):
        """Create a database service."""

        super(DatabaseService, self).__init__(service_type="rax:database",
                                              service_name="cloudDatabases",
                                              version=version)

## Instruction:
Set default version for cloud databases.
## Code After:

from openstack import service_filter


class DatabaseService(service_filter.ServiceFilter):
    """The database service."""

    valid_versions = [service_filter.ValidVersion('v1', path='v1.0')]

    def __init__(self, version=None):
        """Create a database service."""

        if not version:
            version = "v1"

        super(DatabaseService, self).__init__(service_type="rax:database",
                                              service_name="cloudDatabases",
                                              version=version)
