cord-776 create build / runtime containers for autmation uservices
Change-Id: I246973192adef56a250ffe93a5f65fff488840c1
diff --git a/automation/vendor/gopkg.in/juju/names.v2/ipaddress.go b/automation/vendor/gopkg.in/juju/names.v2/ipaddress.go
new file mode 100644
index 0000000..b92a389
--- /dev/null
+++ b/automation/vendor/gopkg.in/juju/names.v2/ipaddress.go
@@ -0,0 +1,46 @@
+// Copyright 2015 Canonical Ltd.
+// Licensed under the LGPLv3, see LICENCE file for details.
+
+package names
+
+import (
+ "github.com/juju/utils"
+)
+
+const IPAddressTagKind = "ipaddress"
+
+// IsValidIPAddress returns whether id is a valid IP address ID.
+// Here it simply is checked if it is a valid UUID.
+func IsValidIPAddress(id string) bool {
+ return utils.IsValidUUIDString(id)
+}
+
+type IPAddressTag struct {
+ id utils.UUID
+}
+
+func (t IPAddressTag) String() string { return t.Kind() + "-" + t.id.String() }
+func (t IPAddressTag) Kind() string { return IPAddressTagKind }
+func (t IPAddressTag) Id() string { return t.id.String() }
+
+// NewIPAddressTag returns the tag for the IP address with the given ID (UUID).
+func NewIPAddressTag(id string) IPAddressTag {
+ uuid, err := utils.UUIDFromString(id)
+ if err != nil {
+ panic(err)
+ }
+ return IPAddressTag{id: uuid}
+}
+
+// ParseIPAddressTag parses an IP address tag string.
+func ParseIPAddressTag(ipAddressTag string) (IPAddressTag, error) {
+ tag, err := ParseTag(ipAddressTag)
+ if err != nil {
+ return IPAddressTag{}, err
+ }
+ ipat, ok := tag.(IPAddressTag)
+ if !ok {
+ return IPAddressTag{}, invalidTagError(ipAddressTag, IPAddressTagKind)
+ }
+ return ipat, nil
+}