Пример #1
0
    def __init__(self, parentMoOrDn, markDirty, *namingVals, **creationProps):
        """Initialize a managed object (MO).

        This should not be called directly.  Instead initialize the Mo from
        the model that you need.

        Args:
          parentMoOrDn (str or cobra.mit.naming.Dn or cobra.mit.mo.Mo): The
            parent managed object (MO) or distinguished name (Dn).
          markDirty (bool): If True, the MO is marked has having changes that
            need to be committed.  If False the Mo is not marked as having
            changes that need to be committed.
          *namingVals: Required values that are used to name the Mo, i.e. they
            become part of the MOs distinguished name.
          **creationProps: Properties to be set at the time the MO is created,
            these properties can also be set after the property is created if
            needed.

        Raises:
          NotImplementedError: If this class is called directly
        """
        if self.__class__ == Mo:
            raise NotImplementedError('Mo cannot be instantiated.')
        BaseMo.__init__(self, parentMoOrDn, markDirty, *namingVals,
                        **creationProps)
Пример #2
0
    def delete(self):
        """ Mark the Mo ad deleted.

        If this mo is committed, the corresponding mo in the backend will be
        deleted.
        """
        BaseMo._delete(self)
Пример #3
0
    def __init__(self, parentMoOrDn, markDirty, *namingVals, **creationProps):
        """Initialize a managed object (MO).

        This should not be called directly.  Instead initialize the Mo from
        the model that you need.

        Args:
          parentMoOrDn (str or cobra.mit.naming.Dn or cobra.mit.mo.Mo): The
            parent managed object (MO) or distinguished name (Dn).
          markDirty (bool): If True, the MO is marked has having changes that
            need to be committed.  If False the Mo is not marked as having
            changes that need to be committed.
          *namingVals: Required values that are used to name the Mo, i.e. they
            become part of the MOs distinguished name.
          **creationProps: Properties to be set at the time the MO is created,
            these properties can also be set after the property is created if
            needed.

        Raises:
          NotImplementedError: If this class is called directly
        """
        if self.__class__ == Mo:
            raise NotImplementedError('Mo cannot be instantiated.')
        BaseMo.__init__(self, parentMoOrDn, markDirty, *namingVals,
                        **creationProps)
Пример #4
0
    def delete(self):
        """ Mark the Mo ad deleted.

        If this mo is committed, the corresponding mo in the backend will be
        deleted.
        """
        BaseMo._delete(self)
Пример #5
0
    def numChildren(self):
        """Get the number of children.

        Returns:
          int: The number of children that this Mo has.
        """
        return BaseMo._numChildren(self)
Пример #6
0
    def children(self):
        """Get the children iterator.

        Returns:
          iterator: An iterator for the children of this Mo.
        """
        return BaseMo._children(self)
Пример #7
0
    def dirtyProps(self):
        """Get the properties that are marked as dirty.

        Returns:
          set: The set of properties that are dirty.
        """
        return BaseMo._dirtyProps(self)
Пример #8
0
    def parent(self):
        """Get the parent Mo.

        Returns:
          cobra.mit.mo.Mo: The parent Mo.
        """
        return BaseMo._parent(self)
Пример #9
0
    def dn(self):  # pylint:disable=invalid-name
        """Get the distinguished name.

        Returns:
          cobra.mit.naming.Dn: The Dn for this Mo.
        """
        return BaseMo._dn(self)
Пример #10
0
    def status(self):
        """Get the status.

        Returns:
          cobra.internal.base.moimpl.MoStatus: The status for this Mo.
        """
        return BaseMo._status(self)
Пример #11
0
    def rn(self):  # pylint:disable=invalid-name
        """Get the relative name.

        Returns:
          cobra.mit.naming.Rn: The relative name for this Mo.
        """
        return BaseMo._rn(self)
Пример #12
0
    def dn(self):  # pylint:disable=invalid-name
        """Get the distinguished name.

        Returns:
          cobra.mit.naming.Dn: The Dn for this Mo.
        """
        return BaseMo._dn(self)
Пример #13
0
    def parentDn(self):
        """Get the parent distinguished name.

        Returns:
          cobra.mit.naming.Dn: The parent Dn.
        """
        return BaseMo._parentDn(self)
Пример #14
0
    def children(self):
        """Get the children iterator.

        Returns:
          iterator: An iterator for the children of this Mo.
        """
        return BaseMo._children(self)
Пример #15
0
    def numChildren(self):
        """Get the number of children.

        Returns:
          int: The number of children that this Mo has.
        """
        return BaseMo._numChildren(self)
Пример #16
0
    def dirtyProps(self):
        """Get the properties that are marked as dirty.

        Returns:
          set: The set of properties that are dirty.
        """
        return BaseMo._dirtyProps(self)
Пример #17
0
    def status(self):
        """Get the status.

        Returns:
          cobra.internal.base.moimpl.MoStatus: The status for this Mo.
        """
        return BaseMo._status(self)
Пример #18
0
    def parentDn(self):
        """Get the parent distinguished name.

        Returns:
          cobra.mit.naming.Dn: The parent Dn.
        """
        return BaseMo._parentDn(self)
Пример #19
0
    def rn(self):  # pylint:disable=invalid-name
        """Get the relative name.

        Returns:
          cobra.mit.naming.Rn: The relative name for this Mo.
        """
        return BaseMo._rn(self)
Пример #20
0
    def parent(self):
        """Get the parent Mo.

        Returns:
          cobra.mit.mo.Mo: The parent Mo.
        """
        return BaseMo._parent(self)
Пример #21
0
    def isPropDirty(self, propName):
        """Check if a property has been modified on this managed object.

        Args:
          propName (str): The property name as a string

        Returns:
          bool: True if the property has been modified and not commited, False
            otherwise
        """
        return BaseMo._isPropDirty(self, propName)
Пример #22
0
    def isPropDirty(self, propName):
        """Check if a property has been modified on this managed object.

        Args:
          propName (str): The property name as a string

        Returns:
          bool: True if the property has been modified and not commited, False
            otherwise
        """
        return BaseMo._isPropDirty(self, propName)
Пример #23
0
 def numChildren(self):
     """
     Returns the number of child managed objects (MOs).
     """    
     return BaseMo._numChildren(self)
Пример #24
0
 def children(self):
     """
     Returns the child managed objects (MOs).
     """    
     return BaseMo._children(self)
Пример #25
0
 def dirtyProps(self):
     """
     Returns modified properties that have not been committed.
     """    
     return BaseMo._dirtyProps(self)
Пример #26
0
 def parent(self):
     """
     Returns the parent managed object (MO).
     """    
     return BaseMo._parent(self)
Пример #27
0
 def children(self):
     """
     Returns the child managed objects (MOs).
     """    
     return BaseMo._children(self)
Пример #28
0
 def dn(self):
     """
     Returns the distinguished name (Dn) of the managed object (MO).
     """    
     return BaseMo._dn(self)
Пример #29
0
 def __getattr__(self, propName):
     """
     Returns a managed object (MO) attribute.
     """    
     return BaseMo.__getattr__(self, propName)
Пример #30
0
 def __init__(self, parentMoOrDn, markDirty, *namingVals, **creationProps):
     if self.__class__ == Mo:
         raise NotImplementedError('Mo cannot be instantiated.')
     BaseMo.__init__(self, parentMoOrDn, markDirty, *namingVals, **creationProps)
Пример #31
0
 def status(self):
     """
     Returns the managed object (MO) status.
     """    
     return BaseMo._status(self)
Пример #32
0
 def parentDn(self):
     """
      Returns the distinguished name (Dn) of the parent managed object (MO).
     """    
     return BaseMo._parentDn(self)
Пример #33
0
 def parent(self):
     """
     Returns the parent managed object (MO).
     """    
     return BaseMo._parent(self)
Пример #34
0
 def resetProps(self):
     """
     Resets managed object (MO) properties, discarding uncommitted changes.
     """    
     BaseMo._resetProps(self)
Пример #35
0
 def isPropDirty(self, propName):
     """
     Returns a value indicating whether a given property has a new value that has not been committed.
     """    
     return BaseMo._isPropDirty(self, propName)
Пример #36
0
 def numChildren(self):
     """
     Returns the number of child managed objects (MOs).
     """    
     return BaseMo._numChildren(self)
Пример #37
0
 def isPropDirty(self, propName):
     """
     Returns a value indicating whether a given property has a new value that has not been committed.
     """    
     return BaseMo._isPropDirty(self, propName)
Пример #38
0
 def resetProps(self):
     """
     Resets managed object (MO) properties, discarding uncommitted changes.
     """    
     BaseMo._resetProps(self)
Пример #39
0
 def __getattr__(self, propName):
     """Implement getattr()."""
     return BaseMo.__getattr__(self, propName)
Пример #40
0
 def rn(self):
     """
     Returns the relative name (Rn) of the managed object (MO).
     """    
     return BaseMo._rn(self)
Пример #41
0
 def parentDn(self):
     """
      Returns the distinguished name (Dn) of the parent managed object (MO).
     """    
     return BaseMo._parentDn(self)
Пример #42
0
    def resetProps(self):
        """Reset the managed object (MO) properties.

        This will discard uncommitted changes.
        """
        BaseMo._resetProps(self)
Пример #43
0
 def dirtyProps(self):
     """
     Returns modified properties that have not been committed.
     """    
     return BaseMo._dirtyProps(self)
Пример #44
0
 def __setattr__(self, propName, propValue):
     """Implement setattr()."""
     BaseMo.__setattr__(self, propName, propValue)
Пример #45
0
 def __setattr__(self, propName, propValue):
     """
     Sets a managed object (MO) attribute.
     """    
     BaseMo.__setattr__(self, propName, propValue)
Пример #46
0
 def __init__(self, parentMoOrDn, markDirty, *namingVals, **creationProps):
     if self.__class__ == Mo:
         raise NotImplementedError('Mo cannot be instantiated.')
     BaseMo.__init__(self, parentMoOrDn, markDirty, *namingVals, **creationProps)
Пример #47
0
 def dn(self):
     """
     Returns the distinguished name (Dn) of the managed object (MO).
     """    
     return BaseMo._dn(self)
Пример #48
0
 def __getattr__(self, propName):
     """Implement getattr()."""
     return BaseMo.__getattr__(self, propName)
Пример #49
0
 def rn(self):
     """
     Returns the relative name (Rn) of the managed object (MO).
     """    
     return BaseMo._rn(self)
Пример #50
0
    def resetProps(self):
        """Reset the managed object (MO) properties.

        This will discard uncommitted changes.
        """
        BaseMo._resetProps(self)
Пример #51
0
 def status(self):
     """
     Returns the managed object (MO) status.
     """    
     return BaseMo._status(self)
Пример #52
0
 def __getattr__(self, propName):
     """
     Returns a managed object (MO) attribute.
     """    
     return BaseMo.__getattr__(self, propName)
Пример #53
0
 def __setattr__(self, propName, propValue):
     """Implement setattr()."""
     BaseMo.__setattr__(self, propName, propValue)
Пример #54
0
 def test_baseMo_init_raises(self):
     with pytest.raises(NotImplementedError):
         BaseMo('uni', True)
Пример #55
0
 def __setattr__(self, propName, propValue):
     """
     Sets a managed object (MO) attribute.
     """    
     BaseMo.__setattr__(self, propName, propValue)