pkg/environment: Remove some file-based functions
This commit removes certain file-based functions from 'pkg/environment', continuing the migration to entirely remove the package.
This commit is contained in:
parent
39207a1cb5
commit
45540ab253
20 changed files with 52 additions and 120 deletions
|
|
@ -8,6 +8,7 @@ import (
|
|||
"crypto/x509"
|
||||
"encoding/pem"
|
||||
"io"
|
||||
"os"
|
||||
|
||||
"github.com/FAU-CDI/wisski-distillery/pkg/environment"
|
||||
"github.com/FAU-CDI/wisski-distillery/pkg/logging"
|
||||
|
|
@ -64,7 +65,7 @@ func (ssh2 *SSH2) UseOrMakeHostKey(progress io.Writer, ctx context.Context, serv
|
|||
func (ssh2 *SSH2) ReadOrMakeHostKey(progress io.Writer, ctx context.Context, privateKeyPath string, algorithm HostKeyAlgorithm) (key gossh.Signer, err error) {
|
||||
hostKey := NewHostKey(algorithm)
|
||||
|
||||
if _, e := ssh2.Environment.Lstat(privateKeyPath); environment.IsNotExist(e) { // path doesn't exist => generate a new key there!
|
||||
if _, e := os.Lstat(privateKeyPath); environment.IsNotExist(e) { // path doesn't exist => generate a new key there!
|
||||
err = ssh2.makeHostKey(progress, ctx, hostKey, privateKeyPath)
|
||||
if err != nil {
|
||||
err = errors.Wrap(err, "Unable to generate new host key")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue