Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 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@cs.utwente.nl> |
| 9 | .. sectionauthor:: Moshe Zadka <moshez@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 | |
Georg Brandl | 55ac8f0 | 2007-09-01 13:51:09 +0000 | [diff] [blame] | 29 | The *domain* argument allows to override the NIS domain used for the lookup. If |
| 30 | unspecified, lookup is in the default NIS domain. |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 31 | |
| 32 | |
| 33 | .. function:: cat(mapname[, domain=default_domain]) |
| 34 | |
| 35 | Return a dictionary mapping *key* to *value* such that ``match(key, |
| 36 | mapname)==value``. Note that both keys and values of the dictionary are |
| 37 | arbitrary arrays of bytes. |
| 38 | |
| 39 | Note that *mapname* is first checked if it is an alias to another name. |
| 40 | |
Georg Brandl | 55ac8f0 | 2007-09-01 13:51:09 +0000 | [diff] [blame] | 41 | The *domain* argument allows to override the NIS domain used for the lookup. If |
| 42 | unspecified, lookup is in the default NIS domain. |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 43 | |
| 44 | |
| 45 | .. function:: maps([domain=default_domain]) |
| 46 | |
| 47 | Return a list of all valid maps. |
| 48 | |
Georg Brandl | 55ac8f0 | 2007-09-01 13:51:09 +0000 | [diff] [blame] | 49 | The *domain* argument allows to override the NIS domain used for the lookup. If |
| 50 | unspecified, lookup is in the default NIS domain. |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 51 | |
| 52 | |
| 53 | .. function:: get_default_domain() |
| 54 | |
| 55 | Return the system default NIS domain. |
| 56 | |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 57 | |
| 58 | The :mod:`nis` module defines the following exception: |
| 59 | |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 60 | .. exception:: error |
| 61 | |
| 62 | An error raised when a NIS function returns an error code. |
| 63 | |