From 2be9bc5c43d53fb2e29eb5fddb191b6cf7f34b0e Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Mon, 30 Mar 2015 11:55:46 +0300 Subject: [PATCH] fix Signed-off-by: Vasiliy Tolstov --- system/networkd_freebsd.go | 21 +++++++++++++++++++++ system/{networkd.go => networkd_linux.go} | 0 system/ssh_key.go | 6 ++++++ system/systemd.go | 2 +- 4 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 system/networkd_freebsd.go rename system/{networkd.go => networkd_linux.go} (100%) diff --git a/system/networkd_freebsd.go b/system/networkd_freebsd.go new file mode 100644 index 0000000..dd13e2a --- /dev/null +++ b/system/networkd_freebsd.go @@ -0,0 +1,21 @@ +// Copyright 2015 CoreOS, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package system + +import "github.com/vtolstov/cloudinit/network" + +func RestartNetwork(interfaces []network.InterfaceGenerator) (err error) { + return nil +} diff --git a/system/networkd.go b/system/networkd_linux.go similarity index 100% rename from system/networkd.go rename to system/networkd_linux.go diff --git a/system/ssh_key.go b/system/ssh_key.go index f897308..a75896c 100644 --- a/system/ssh_key.go +++ b/system/ssh_key.go @@ -36,6 +36,12 @@ func AuthorizeSSHKeys(user string, keysName string, keys []string) error { return err } + if _, err = os.Stat(home + "/.ssh"); err != nil { + if err = os.MkdirAll(home+"/.ssh", os.FileMode(0755)); err != nil { + return err + } + } + authorized_file := fmt.Sprintf("%s/.ssh/authorized_keys", home) f, err := os.OpenFile(authorized_file, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644) if err != nil { diff --git a/system/systemd.go b/system/systemd.go index cc5e224..1eb5cc4 100644 --- a/system/systemd.go +++ b/system/systemd.go @@ -22,7 +22,7 @@ import ( "path" "strings" - "github.com/coreos/coreos-cloudinit/config" + "github.com/vtolstov/cloudinit/config" ) func NewUnitManager(root string) UnitManager {