
import abc

import six


@six.add_metaclass(abc.ABCMeta)
class Backend(object):
    """Base class for persistence backends."""

    def __init__(self, conf):
        if not conf:
            conf = {}
        if not isinstance(conf, dict):
            raise TypeError("Configuration dictionary expected not: %s"
                            % type(conf))
        self._conf = conf
        self._audit = 'audit'
        self._repair = 'repair'

    @abc.abstractmethod
    def open(self):
        pass

    @abc.abstractmethod
    def close(self):
        """Closes any resources this backend has open."""
        pass


import abc

import six


@six.add_metaclass(abc.ABCMeta)
class Backend(object):
    """Base class for persistence backends."""

    def __init__(self, conf):
        if not conf:
            conf = {}
        if not isinstance(conf, dict):
            raise TypeError("Configuration dictionary expected not: %s"
                            % type(conf))
        self._conf = conf
        self._audit = 'audit'
        self._repair = 'repair'

    @abc.abstractmethod
    def open(self):
        pass

    @abc.abstractmethod
    def close(self):
        """Closes any resources this backend has open."""
        pass

    @abc.abstractmethod
    def get_audits(self):
        pass

    @abc.abstractmethod
    def get_repairs(self):
        pass

    @abc.abstractmethod
    def audit_cfg_from_name(self, name):
        pass

    @abc.abstractmethod
    def repair_cfg_from_name(self, name):
        pass

    @abc.abstractmethod
    def get_script_cfg(self, script_type):
        pass

    @abc.abstractmethod
    def check_script_exists(self, script_type, script_name):
        pass

    @abc.abstractmethod
    def add_script(self, script_type, data):
        pass

Add some abstract methods to backend
Add some abstract methods to backend

Added some methods in base.py that should probably be defined in
every backend

Change-Id: I6f99994b82c2f17083d83b4723f3b4d61fc80160

  
  import abc
  
  import six
  
  
  @six.add_metaclass(abc.ABCMeta)
  class Backend(object):
      """Base class for persistence backends."""
  
      def __init__(self, conf):
          if not conf:
              conf = {}
          if not isinstance(conf, dict):
              raise TypeError("Configuration dictionary expected not: %s"
                              % type(conf))
          self._conf = conf
          self._audit = 'audit'
          self._repair = 'repair'
  
      @abc.abstractmethod
      def open(self):
          pass
  
      @abc.abstractmethod
      def close(self):
          """Closes any resources this backend has open."""
          pass
  
+     @abc.abstractmethod
+     def get_audits(self):
+         pass
+ 
+     @abc.abstractmethod
+     def get_repairs(self):
+         pass
+ 
+     @abc.abstractmethod
+     def audit_cfg_from_name(self, name):
+         pass
+ 
+     @abc.abstractmethod
+     def repair_cfg_from_name(self, name):
+         pass
+ 
+     @abc.abstractmethod
+     def get_script_cfg(self, script_type):
+         pass
+ 
+     @abc.abstractmethod
+     def check_script_exists(self, script_type, script_name):
+         pass
+ 
+     @abc.abstractmethod
+     def add_script(self, script_type, data):
+         pass
+ 
Add some abstract methods to backend
## Code Before:

import abc

import six


@six.add_metaclass(abc.ABCMeta)
class Backend(object):
    """Base class for persistence backends."""

    def __init__(self, conf):
        if not conf:
            conf = {}
        if not isinstance(conf, dict):
            raise TypeError("Configuration dictionary expected not: %s"
                            % type(conf))
        self._conf = conf
        self._audit = 'audit'
        self._repair = 'repair'

    @abc.abstractmethod
    def open(self):
        pass

    @abc.abstractmethod
    def close(self):
        """Closes any resources this backend has open."""
        pass

## Instruction:
Add some abstract methods to backend
## Code After:

import abc

import six


@six.add_metaclass(abc.ABCMeta)
class Backend(object):
    """Base class for persistence backends."""

    def __init__(self, conf):
        if not conf:
            conf = {}
        if not isinstance(conf, dict):
            raise TypeError("Configuration dictionary expected not: %s"
                            % type(conf))
        self._conf = conf
        self._audit = 'audit'
        self._repair = 'repair'

    @abc.abstractmethod
    def open(self):
        pass

    @abc.abstractmethod
    def close(self):
        """Closes any resources this backend has open."""
        pass

    @abc.abstractmethod
    def get_audits(self):
        pass

    @abc.abstractmethod
    def get_repairs(self):
        pass

    @abc.abstractmethod
    def audit_cfg_from_name(self, name):
        pass

    @abc.abstractmethod
    def repair_cfg_from_name(self, name):
        pass

    @abc.abstractmethod
    def get_script_cfg(self, script_type):
        pass

    @abc.abstractmethod
    def check_script_exists(self, script_type, script_name):
        pass

    @abc.abstractmethod
    def add_script(self, script_type, data):
        pass
