Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
This commit is contained in:
Василий Толстов 2015-03-30 11:55:46 +03:00
parent de2a74b621
commit 2be9bc5c43
4 changed files with 28 additions and 1 deletions

View File

@ -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
}

View File

@ -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 {

View File

@ -22,7 +22,7 @@ import (
"path"
"strings"
"github.com/coreos/coreos-cloudinit/config"
"github.com/vtolstov/cloudinit/config"
)
func NewUnitManager(root string) UnitManager {