github.com/cloud-green/juju@v0.0.0-20151002100041-a00291338d3d/provider/joyent/userdata.go (about)

     1  // Copyright 2015 Canonical Ltd.
     2  // Copyright 2015 Cloudbase Solutions SRL
     3  // Licensed under the AGPLv3, see LICENCE file for details.
     4  
     5  package joyent
     6  
     7  import (
     8  	"github.com/juju/errors"
     9  
    10  	jujuos "github.com/juju/utils/os"
    11  )
    12  
    13  type JoyentRenderer struct{}
    14  
    15  func (JoyentRenderer) EncodeUserdata(udata []byte, os jujuos.OSType) ([]byte, error) {
    16  	switch os {
    17  	case jujuos.Ubuntu, jujuos.CentOS:
    18  		return udata, nil
    19  	default:
    20  		return nil, errors.Errorf("Cannot encode userdata for OS: %s", os.String())
    21  	}
    22  }