Пример #1
0
 def reg_ssh_host_key(self):
     keypair_type = conf.get_ssh_host_keypair_type()
     if conf.get_regenerate_ssh_host_key():
         fileutil.rm_files(conf.get_ssh_key_glob())
         keygen_cmd = "ssh-keygen -N '' -t {0} -f {1}"
         shellutil.run(keygen_cmd.format(keypair_type,
                     conf.get_ssh_key_private_path()))
     return self.get_ssh_host_key_thumbprint()
Пример #2
0
 def reg_ssh_host_key(self):
     keypair_type = conf.get_ssh_host_keypair_type()
     if conf.get_regenerate_ssh_host_key():
         fileutil.rm_files(conf.get_ssh_key_glob())
         keygen_cmd = "ssh-keygen -N '' -t {0} -f {1}"
         shellutil.run(
             keygen_cmd.format(keypair_type,
                               conf.get_ssh_key_private_path()))
     return self.get_ssh_host_key_thumbprint()
Пример #3
0
 def reg_ssh_host_key(self):
     keypair_type = conf.get_ssh_host_keypair_type()
     if conf.get_regenerate_ssh_host_key():
         fileutil.rm_files(conf.get_ssh_key_glob())
         if conf.get_ssh_host_keypair_mode() == "auto":
             '''
             The -A option generates all supported key types.
             This is supported since OpenSSH 5.9 (2011).
             '''
             shellutil.run("ssh-keygen -A")
         else:
             keygen_cmd = "ssh-keygen -N '' -t {0} -f {1}"
             shellutil.run(keygen_cmd.
                           format(keypair_type,
                                  conf.get_ssh_key_private_path()))
     return self.get_ssh_host_key_thumbprint()
Пример #4
0
 def reg_ssh_host_key(self):
     keypair_type = conf.get_ssh_host_keypair_type()
     if conf.get_regenerate_ssh_host_key():
         fileutil.rm_files(conf.get_ssh_key_glob())
         if conf.get_ssh_host_keypair_mode() == "auto":
             '''
             The -A option generates all supported key types.
             This is supported since OpenSSH 5.9 (2011).
             '''
             shellutil.run("ssh-keygen -A")
         else:
             keygen_cmd = "ssh-keygen -N '' -t {0} -f {1}"
             shellutil.run(
                 keygen_cmd.format(keypair_type,
                                   conf.get_ssh_key_private_path()))
     return self.get_ssh_host_key_thumbprint()
Пример #5
0
 def regen_ssh_host_key(self, warnings, actions):
     warnings.append("WARNING! All SSH host key pairs will be deleted.")
     actions.append(DeprovisionAction(fileutil.rm_files,
                     [conf.get_ssh_key_glob()]))
Пример #6
0
 def regen_ssh_host_key(self, warnings, actions):
     warnings.append("WARNING! All SSH host key pairs will be deleted.")
     actions.append(
         DeprovisionAction(fileutil.rm_files, [conf.get_ssh_key_glob()]))
Пример #7
0
 def test_get_ssh_key_glob(self):
     self.assertTrue(
         conf.get_ssh_key_glob(self.conf).startswith("/notareal/path"))