Custom Connect Command
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
-
154 def get_connect_commands(self, instance, use_ipv6=False): 155 """ Generate connection command based on template.""" 156 single_command = instance.get_connect_command(use_ipv6) 157 if single_command: # can we even connect to that VM 158 commands = self.user.command_set.filter( 159 access_method=instance.access_method) 160 if commands.count() < 1: 161 return [single_command] 162 else: 163 return [ 164 command.template % { 165 'port': instance.get_connect_port(use_ipv6=use_ipv6), 166 'host': instance.get_connect_host(use_ipv6=use_ipv6), 167 'password': instance.pw, 168 'username': 'cloud', 169 } for command in commands] -
Owner
What happens if template is wrong?
-