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

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

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

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

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

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

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

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

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

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

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

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

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