Example #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)
Example #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)
Example #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)
Example #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)
Example #5
0
    def numChildren(self):
        """Get the number of children.

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

        Returns:
          iterator: An iterator for the children of this Mo.
        """
        return BaseMo._children(self)
Example #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)
Example #8
0
    def parent(self):
        """Get the parent Mo.

        Returns:
          cobra.mit.mo.Mo: The parent Mo.
        """
        return BaseMo._parent(self)
Example #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)
Example #10
0
    def status(self):
        """Get the status.

        Returns:
          cobra.internal.base.moimpl.MoStatus: The status for this Mo.
        """
        return BaseMo._status(self)
Example #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)
Example #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)
Example #13
0
    def parentDn(self):
        """Get the parent distinguished name.

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

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

        Returns:
          int: The number of children that this Mo has.
        """
        return BaseMo._numChildren(self)
Example #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)
Example #17
0
    def status(self):
        """Get the status.

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

        Returns:
          cobra.mit.naming.Dn: The parent Dn.
        """
        return BaseMo._parentDn(self)
Example #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)
Example #20
0
    def parent(self):
        """Get the parent Mo.

        Returns:
          cobra.mit.mo.Mo: The parent Mo.
        """
        return BaseMo._parent(self)
Example #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)
Example #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)
Example #23
0
 def numChildren(self):
     """
     Returns the number of child managed objects (MOs).
     """    
     return BaseMo._numChildren(self)
Example #24
0
 def children(self):
     """
     Returns the child managed objects (MOs).
     """    
     return BaseMo._children(self)
Example #25
0
 def dirtyProps(self):
     """
     Returns modified properties that have not been committed.
     """    
     return BaseMo._dirtyProps(self)
Example #26
0
 def parent(self):
     """
     Returns the parent managed object (MO).
     """    
     return BaseMo._parent(self)
Example #27
0
File: mo.py Project: tm0nk/cobra-j
 def children(self):
     """
     Returns the child managed objects (MOs).
     """    
     return BaseMo._children(self)
Example #28
0
File: mo.py Project: tm0nk/cobra-j
 def dn(self):
     """
     Returns the distinguished name (Dn) of the managed object (MO).
     """    
     return BaseMo._dn(self)
Example #29
0
 def __getattr__(self, propName):
     """
     Returns a managed object (MO) attribute.
     """    
     return BaseMo.__getattr__(self, propName)
Example #30
0
File: mo.py Project: tm0nk/cobra-j
 def __init__(self, parentMoOrDn, markDirty, *namingVals, **creationProps):
     if self.__class__ == Mo:
         raise NotImplementedError('Mo cannot be instantiated.')
     BaseMo.__init__(self, parentMoOrDn, markDirty, *namingVals, **creationProps)
Example #31
0
File: mo.py Project: tm0nk/cobra-j
 def status(self):
     """
     Returns the managed object (MO) status.
     """    
     return BaseMo._status(self)
Example #32
0
File: mo.py Project: tm0nk/cobra-j
 def parentDn(self):
     """
      Returns the distinguished name (Dn) of the parent managed object (MO).
     """    
     return BaseMo._parentDn(self)
Example #33
0
File: mo.py Project: tm0nk/cobra-j
 def parent(self):
     """
     Returns the parent managed object (MO).
     """    
     return BaseMo._parent(self)
Example #34
0
File: mo.py Project: tm0nk/cobra-j
 def resetProps(self):
     """
     Resets managed object (MO) properties, discarding uncommitted changes.
     """    
     BaseMo._resetProps(self)
Example #35
0
File: mo.py Project: tm0nk/cobra-j
 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)
Example #36
0
File: mo.py Project: tm0nk/cobra-j
 def numChildren(self):
     """
     Returns the number of child managed objects (MOs).
     """    
     return BaseMo._numChildren(self)
Example #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)
Example #38
0
 def resetProps(self):
     """
     Resets managed object (MO) properties, discarding uncommitted changes.
     """    
     BaseMo._resetProps(self)
Example #39
0
 def __getattr__(self, propName):
     """Implement getattr()."""
     return BaseMo.__getattr__(self, propName)
Example #40
0
File: mo.py Project: tm0nk/cobra-j
 def rn(self):
     """
     Returns the relative name (Rn) of the managed object (MO).
     """    
     return BaseMo._rn(self)
Example #41
0
 def parentDn(self):
     """
      Returns the distinguished name (Dn) of the parent managed object (MO).
     """    
     return BaseMo._parentDn(self)
Example #42
0
    def resetProps(self):
        """Reset the managed object (MO) properties.

        This will discard uncommitted changes.
        """
        BaseMo._resetProps(self)
Example #43
0
File: mo.py Project: tm0nk/cobra-j
 def dirtyProps(self):
     """
     Returns modified properties that have not been committed.
     """    
     return BaseMo._dirtyProps(self)
Example #44
0
 def __setattr__(self, propName, propValue):
     """Implement setattr()."""
     BaseMo.__setattr__(self, propName, propValue)
Example #45
0
File: mo.py Project: tm0nk/cobra-j
 def __setattr__(self, propName, propValue):
     """
     Sets a managed object (MO) attribute.
     """    
     BaseMo.__setattr__(self, propName, propValue)
Example #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)
Example #47
0
 def dn(self):
     """
     Returns the distinguished name (Dn) of the managed object (MO).
     """    
     return BaseMo._dn(self)
Example #48
0
 def __getattr__(self, propName):
     """Implement getattr()."""
     return BaseMo.__getattr__(self, propName)
Example #49
0
 def rn(self):
     """
     Returns the relative name (Rn) of the managed object (MO).
     """    
     return BaseMo._rn(self)
Example #50
0
    def resetProps(self):
        """Reset the managed object (MO) properties.

        This will discard uncommitted changes.
        """
        BaseMo._resetProps(self)
Example #51
0
 def status(self):
     """
     Returns the managed object (MO) status.
     """    
     return BaseMo._status(self)
Example #52
0
File: mo.py Project: tm0nk/cobra-j
 def __getattr__(self, propName):
     """
     Returns a managed object (MO) attribute.
     """    
     return BaseMo.__getattr__(self, propName)
Example #53
0
 def __setattr__(self, propName, propValue):
     """Implement setattr()."""
     BaseMo.__setattr__(self, propName, propValue)
Example #54
0
 def test_baseMo_init_raises(self):
     with pytest.raises(NotImplementedError):
         BaseMo('uni', True)
Example #55
0
 def __setattr__(self, propName, propValue):
     """
     Sets a managed object (MO) attribute.
     """    
     BaseMo.__setattr__(self, propName, propValue)