sample_python_augeas.py 251 B

123456789
  1. import augeas
  2. a = augeas.Augeas(root="/")
  3. hosts = a.match("/files/etc/hosts/*")
  4. assert(hosts is not None)
  5. assert(len(hosts) == 2)
  6. assert(a.get("/files/etc/hosts/1/ipaddr") == "127.0.0.1")
  7. assert(a.get("/files/etc/hosts/1/canonical") == "localhost")