pymacds module

17 views
Skip to first unread message

Nigel Kersten

unread,
Oct 12, 2010, 1:25:03 PM10/12/10
to pymac...@googlegroups.com
http://code.google.com/p/pymacadmin/downloads/detail?name=pymacds-0.2-py2.5.egg
http://code.google.com/p/pymacadmin/downloads/detail?name=pymacds-0.2-py2.6.egg

You should be able to download them and run:

sudo easy_install-2.5 pymacds-0.2-py2.5.egg
sudo easy_install-2.6 pymacds-0.2-py2.6.egg

Then something like:


nigelk$ python2.5
Python 2.5.4 (r254:67916, Feb 11 2010, 00:50:55)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pymacds
>>> pymacds.UserAttribute('nigelk', 'NFSHomeDirectory')
[u'/Users/nigelk']
>>> pymacds.UserAttribute('nigelk', 'UniqueID')
[u'12345']
>>> pymacds.GetContactsNodes()
['/LDAPv3/mycorp.ldap.fqdn']
>>> pymacds.GetSearchNodes()
['/Local/Default', '/BSD/local', '/mycorp.ldap.fqdn']
>>>

We have a whole bunch of methods that should be reasonably useful for people.

The "Ensure{Contacts,Search}Node{Present,Absent}" methods are
particularly useful for triggering with crankd.


def FlushCache():
def _GetCSPSearchPathForPath(path):
def _ModifyCSPSearchPathForPath(action, node, path):
def GetSearchNodes():
def GetContactsNodes():
def AddNodeToSearchPath(node):
def AddNodeToContactsPath(node):
def DeleteNodeFromSearchPath(node):
def DeleteNodeFromContactsPath(node):
def EnsureSearchNodePresent(node):
def EnsureSearchNodeAbsent(node):
def EnsureContactsNodePresent(node):
def EnsureContactsNodeAbsent(node):
def DSQuery(dstype, objectname, attribute=None):
def DSSet(dstype, objectname, attribute=None, value=None):
def DSDelete(dstype, objectname, attribute=None, value=None):
def UserAttribute(username, attribute):
def GroupAttribute(groupname, attribute):
def AddUserToLocalGroup(username, group):
def RemoveUserFromLocalGroup(username, group):

Reply all
Reply to author
Forward
0 new messages