For compatibility purpose... :returns: try to return the user record or the first hostname of the list hostnames
(self)
| 977 | return self["hostnames"] |
| 978 | |
| 979 | def hostname(self): |
| 980 | """ |
| 981 | For compatibility purpose... |
| 982 | :returns: try to return the user record or the first hostname of the list hostnames |
| 983 | |
| 984 | """ |
| 985 | hostname = "" |
| 986 | for h in self["hostnames"]: |
| 987 | if h["type"] == "user": |
| 988 | return h["name"] |
| 989 | else: |
| 990 | if len(self["hostnames"]) > 0 and "name" in self["hostnames"][0]: |
| 991 | return self["hostnames"][0]["name"] |
| 992 | else: |
| 993 | return "" |
| 994 | |
| 995 | return hostname |
| 996 | |
| 997 | def state(self): |
| 998 | """ |
no outgoing calls
no test coverage detected