示例#1
0
import sys
import threading

import marshmallow
from marshmallow import fields
from oslo_utils import importutils

from cloudferrylib.utils import local_db

LOG = logging.getLogger(__name__)
type_aliases = {}
local_db.execute_once("""
CREATE TABLE IF NOT EXISTS objects (
    uuid TEXT,
    cloud TEXT,
    type TEXT,
    json TEXT,
    PRIMARY KEY (uuid, cloud, type)
)
""")


class ObjectId(collections.namedtuple('ObjectId', ('id', 'cloud'))):
    """
    Object identifier class containing the identifier itself and cloud name
    as specified in discover.yaml
    """
    @staticmethod
    def from_cloud(cloud, value):
        """
        Create ObjectId based on cloud name and identifier string (used mostly
示例#2
0
import sys
import threading

import marshmallow
from marshmallow import fields
from oslo_utils import importutils

from cloudferrylib.utils import local_db

LOG = logging.getLogger(__name__)
type_aliases = {}
local_db.execute_once("""
CREATE TABLE IF NOT EXISTS objects (
    uuid TEXT,
    cloud TEXT,
    type TEXT,
    json TEXT,
    PRIMARY KEY (uuid, cloud, type)
)
""")


class ObjectId(collections.namedtuple('ObjectId', ('id', 'cloud'))):
    """
    Object identifier class containing the identifier itself and cloud name
    as specified in discover.yaml
    """

    @staticmethod
    def from_cloud(cloud, value):
        """
示例#3
0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import abc

from oslo_utils import importutils

from cloudferrylib.utils import local_db

local_db.execute_once("""
CREATE TABLE IF NOT EXISTS stages (
    stage TEXT,
    signature JSON,
    PRIMARY KEY (stage)
)
""")


class Stage(object):
    __metaclass__ = abc.ABCMeta
    dependencies = []

    @abc.abstractmethod
    def signature(self, config):
        """
        Returns signature for data that will be produced during this stage. If
        the signature differ from the one stored in database, then invalidate
        method will be called.