(self)
| 629 | # if it isn't running yet. |
| 630 | # |
| 631 | def __ping(self): |
| 632 | delay = 0.5 |
| 633 | attempts = 10 |
| 634 | |
| 635 | while attempts > 0: |
| 636 | try: |
| 637 | self.__peer_intf.Ping() |
| 638 | self.__prop_intf.Get('net.openvpn.v3.sessions', 'version') |
| 639 | return |
| 640 | except dbus.exceptions.DBusException as excp: |
| 641 | err = str(excp) |
| 642 | if err.find("org.freedesktop.DBus.Error.AccessDenied:") > 0: |
| 643 | raise RuntimeError("Access denied to the Session Manager (ping)") |
| 644 | time.sleep(delay) |
| 645 | delay *= 1.33 |
| 646 | attempts -= 1 |
| 647 | raise RuntimeError("Could not establish contact with the Session Manager") |
| 648 | |
| 649 | |
| 650 | ## |
no test coverage detected