1 2 :mod:`nis` --- Interface to Sun's NIS (Yellow Pages) 3 ==================================================== 4 5 .. module:: nis 6 :platform: Unix 7 :synopsis: Interface to Sun's NIS (Yellow Pages) library. 8 .. moduleauthor:: Fred Gansevles <Fred.Gansevles (a] cs.utwente.nl> 9 .. sectionauthor:: Moshe Zadka <moshez (a] zadka.site.co.il> 10 11 12 The :mod:`nis` module gives a thin wrapper around the NIS library, useful for 13 central administration of several hosts. 14 15 Because NIS exists only on Unix systems, this module is only available for Unix. 16 17 The :mod:`nis` module defines the following functions: 18 19 20 .. function:: match(key, mapname[, domain=default_domain]) 21 22 Return the match for *key* in map *mapname*, or raise an error 23 (:exc:`nis.error`) if there is none. Both should be strings, *key* is 8-bit 24 clean. Return value is an arbitrary array of bytes (may contain ``NULL`` and 25 other joys). 26 27 Note that *mapname* is first checked if it is an alias to another name. 28 29 .. versionchanged:: 2.5 30 The *domain* argument allows overriding the NIS domain used for the lookup. If 31 unspecified, lookup is in the default NIS domain. 32 33 34 .. function:: cat(mapname[, domain=default_domain]) 35 36 Return a dictionary mapping *key* to *value* such that ``match(key, 37 mapname)==value``. Note that both keys and values of the dictionary are 38 arbitrary arrays of bytes. 39 40 Note that *mapname* is first checked if it is an alias to another name. 41 42 .. versionchanged:: 2.5 43 The *domain* argument allows overriding the NIS domain used for the lookup. If 44 unspecified, lookup is in the default NIS domain. 45 46 47 .. function:: maps([domain=default_domain]) 48 49 Return a list of all valid maps. 50 51 .. versionchanged:: 2.5 52 The *domain* argument allows overriding the NIS domain used for the lookup. If 53 unspecified, lookup is in the default NIS domain. 54 55 56 .. function:: get_default_domain() 57 58 Return the system default NIS domain. 59 60 .. versionadded:: 2.5 61 62 The :mod:`nis` module defines the following exception: 63 64 65 .. exception:: error 66 67 An error raised when a NIS function returns an error code. 68 69