Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1421)

Unified Diff: provider/cloudsigma/environcaps.go

Issue 101970045: Added provider for CloudSigma cloud.
Patch Set: Added provider for CloudSigma cloud. Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « provider/cloudsigma/environ_test.go ('k') | provider/cloudsigma/environfirewall.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: provider/cloudsigma/environcaps.go
=== added file 'provider/cloudsigma/environcaps.go'
--- provider/cloudsigma/environcaps.go 1970-01-01 00:00:00 +0000
+++ provider/cloudsigma/environcaps.go 2014-05-23 09:34:16 +0000
@@ -0,0 +1,50 @@
+// Copyright 2014 Canonical Ltd.
+// Licensed under the AGPLv3, see LICENCE file for details.
+
+package cloudsigma
+
+import (
+ "launchpad.net/juju-core/constraints"
+ "launchpad.net/juju-core/juju/arch"
+)
+
+// SupportedArchitectures returns the image architectures which can
+// be hosted by this environment.
+func (env *environ) SupportedArchitectures() ([]string, error) {
+ return []string{arch.AMD64}, nil
+}
+
+var unsupportedConstraints = []string{
+ constraints.Container,
+ constraints.InstanceType,
+ constraints.Tags,
+}
+
+// ConstraintsValidator returns a Validator instance which
+// is used to validate and merge constraints.
+func (env *environ) ConstraintsValidator() (constraints.Validator, error) {
+ validator := constraints.NewValidator()
+ validator.RegisterUnsupported(unsupportedConstraints)
+ supportedArches, err := env.SupportedArchitectures()
+ if err != nil {
+ return nil, err
+ }
+ validator.RegisterVocabulary(constraints.Arch, supportedArches)
+ return validator, nil
+}
+
+// SupportNetworks returns whether the environment has support to
+// specify networks for services and machines.
+func (env *environ) SupportNetworks() bool {
+ logger.Debugf("environ:SupportedNetworks")
+ return false
+}
+
+// SupportsUnitAssignment returns an error which, if non-nil, indicates
+// that the environment does not support unit placement. If the environment
+// does not support unit placement, then machines may not be created
+// without units, and units cannot be placed explcitly.
+func (env *environ) SupportsUnitPlacement() error {
+ logger.Debugf("cloudsigma:environ:SupportsUnitPlacement not implemented")
+ return nil
+}
« no previous file with comments | « provider/cloudsigma/environ_test.go ('k') | provider/cloudsigma/environfirewall.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b