Skip to content

Conversation

@bavyhappy
Copy link

add osx compatibility in def open_serrver_through_ssh

`
def open_server_through_ssh(self, instances):
for instance in instances:
ip = instance.get_public_ip()

        # Open new terminal with the ssh connection
        if sys.platform == 'darwin':
            os.system(f"""
                osascript -e 'tell app "Terminal"
                    do script "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no {self.__USER_FOR_SSH}@{ip}"
                end tell'
            """)
        else:
            os.system(
                'x-terminal-emulator -e ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no '
                + self.__USER_FOR_SSH + '@' + ip +
                ' > /dev/null 2>/dev/null &'
            )

        # Sleep to avoid overlapping commands
        time.sleep(1)`

Added first version of the script
Removed .pyc files, moved all comments to the python standard (my bad), fixed __get_name_from_tags function
- Added 'reboot' command into information menu
- Added some new useful informations about instance
- Separated instance list into "running" and "stopped"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants