Merge lp:~mvo/snapweb/new-snappy into lp:~snappy-dev/snapweb/trunk

Proposed by Michael Vogt
Status: Approved
Approved by: Sergio Schvezov
Approved revision: 172
Proposed branch: lp:~mvo/snapweb/new-snappy
Merge into: lp:~snappy-dev/snapweb/trunk
Diff against target: 501 lines (+103/-128)
13 files modified
README.md (+20/-5)
avahi/avahi.go (+14/-10)
build.sh (+35/-9)
dependencies.tsv (+4/-2)
oem/oem.go (+5/-4)
pkg/meta/hooks/config (+0/-70)
pkg/meta/package.yaml (+2/-2)
pkg/snappyd (+6/-1)
snappy/common_test.go (+1/-1)
snappy/converge.go (+13/-21)
snappy/converge_test.go (+1/-1)
snappy/handlers.go (+1/-1)
webprogress/meter.go (+1/-1)
To merge this branch: bzr merge lp:~mvo/snapweb/new-snappy
Reviewer Review Type Date Requested Status
Michael Vogt (community) Needs Fixing
Sergio Schvezov Approve
Review via email: mp+277433@code.launchpad.net

Description of the change

Update webdm for new github snappy location and document some missing bits.

This also merges some bits from chipaca.

To post a comment you must log in.
lp:~mvo/snapweb/new-snappy updated
169. By Michael Vogt

README.md: add missing gcc-aarch64-linux-gnu

Revision history for this message
Sergio Schvezov (sergiusens) wrote :

mind merging all of Chipaca's changes?

lp:~mvo/snapweb/new-snappy updated
170. By Michael Vogt

README.md: add missing ubuntu-snappy-cli dependency

171. By Michael Vogt

pkg/meta/package.yaml: use a string for the version

172. By Michael Vogt

merged lp:~chipaca/webdm/mdns-nicer-with-ipv6

Revision history for this message
Michael Vogt (mvo) wrote :

All of those should be merged now.

Revision history for this message
Sergio Schvezov (sergiusens) :
review: Approve
Revision history for this message
Michael Vogt (mvo) wrote :

Well, this is a mess. When I build this package I can not remove any snap from webdm. I get "Error: snappy package not found".

review: Needs Fixing
lp:~mvo/snapweb/new-snappy updated
173. By Michael Vogt

bump version

174. By Michael Vogt

dependencies.tsv: use the latest 15.04 revno for the webdm build

175. By Michael Vogt

improve README.md, 15.10 is the only rev that can build webdm at this point

Revision history for this message
Michael Vogt (mvo) wrote :

Removing works now, I was a bad build (or rather a outdated dependencies.tsv). This works on 15.04 now.

However this will only work with 15.04 because its build with the 15.04 version of snappy and it will try to run sc-seccomp which is no longer available on 16.04. When build against the 16.04 snappy it will break on 15.04 because it expect the apparmor files in a different location.

So to summarize. We need a new webdm that works against the REST API or we need a webdm15.04 and a webdm16.04 in the store.

Revision history for this message
Michael Vogt (mvo) wrote :

Ups, "it was a bad build" of course.

Unmerged revisions

175. By Michael Vogt

improve README.md, 15.10 is the only rev that can build webdm at this point

174. By Michael Vogt

dependencies.tsv: use the latest 15.04 revno for the webdm build

173. By Michael Vogt

bump version

172. By Michael Vogt

merged lp:~chipaca/webdm/mdns-nicer-with-ipv6

171. By Michael Vogt

pkg/meta/package.yaml: use a string for the version

170. By Michael Vogt

README.md: add missing ubuntu-snappy-cli dependency

169. By Michael Vogt

README.md: add missing gcc-aarch64-linux-gnu

168. By Michael Vogt

we also need linux-libc-dev:i386

167. By Michael Vogt

its github.com now

166. By Michael Vogt

libc6-dev-i386 is also needed to build

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'README.md'
--- README.md 2015-05-07 08:25:48 +0000
+++ README.md 2015-12-03 08:16:49 +0000
@@ -2,10 +2,25 @@
22
3## Prerequisites3## Prerequisites
44
5This assumes you have a working go environment with a GOPATH env var setup5This assumes you have a working go environment with a GOPATH env var setup.
6and nodejs and npm installed:6Make sure you have the full multiarch cross build env on 15.10+
77(15.04 won't be able to build arm64):
8 sudo apt-get install nodejs-legacy npm8
9 sudo dpkg --add-architecture i386
10 sudo apt update
11 sudo apt install -y libc6-dev-i386
12 sudo apt install -y linux-libc-dev linux-libc-dev:i386
13 sudo apt install -y ubuntu-snappy-cli
14 sudo apt install -y gcc-arm-linux-gnueabihf
15 sudo apt install -y gcc-aarch64-linux-gnu
16
17Also the full golang with cross-build:
18
19 sudo apt install -y golang-go
20
21Plus ensure that nodejs and npm are installed:
22
23 sudo apt install -y nodejs-legacy npm
924
10Install global npm modules without sudo:25Install global npm modules without sudo:
1126
@@ -42,7 +57,7 @@
4257
43# Installing58# Installing
4459
45Once you have a click package you can install it onto a remote snappy system60Once you have a snap package you can install it onto a remote snappy system
46by running61by running
4762
48 snappy-remote --url ssh://localhost:8022 install [package]63 snappy-remote --url ssh://localhost:8022 install [package]
4964
=== modified file 'avahi/avahi.go'
--- avahi/avahi.go 2015-05-07 23:00:26 +0000
+++ avahi/avahi.go 2015-12-03 08:16:49 +0000
@@ -39,18 +39,22 @@
39)39)
4040
41const timeoutMinutes = 1041const timeoutMinutes = 10
42const inAddr = `%s.local. 60 IN A %s`42const in4Addr = `%s.local. 60 IN A %s`
43const inPtr = `%s.in-addr.arpa. 60 IN PTR %s.local.`43const in6Addr = `%s.local. 60 in AAAA %s`
4444
45var mdnsPublish = mdns.Publish45var mdnsPublish = mdns.Publish
4646
47func tryPublish(hostname, ip string) {47func tryPublish(hostname string, ip net.IP) {
48 rr := fmt.Sprintf(inAddr, hostname, ip)48 inAddr := in4Addr
49 if ip.To4() == nil {
50 inAddr = in6Addr
51 }
52 rr := fmt.Sprintf(inAddr, hostname, ip.String())
4953
50 logger.Println("Publishing", rr)54 logger.Println("Publishing", rr)
5155
52 if err := mdnsPublish(rr); err != nil {56 if err := mdnsPublish(rr); err != nil {
53 logger.Printf(`Unable to publish record "%s": %v`, rr, err)57 logger.Printf(`Unable to publish record %q: %v`, rr, err)
54 return58 return
55 }59 }
56}60}
@@ -102,17 +106,17 @@
102 return106 return
103 }107 }
104108
105 if strings.ContainsRune(hostname, '.') {109 if idx := strings.IndexByte(hostname, '.'); idx > -1 {
106 hostname = strings.Split(hostname, ".")[0]110 hostname = hostname[:idx]
107 }111 }
108112
109 if hostname == hostnameLocalhost {113 if hostname == hostnameLocalhost {
110 hostname = hostnameWedbm114 hostname = hostnameWedbm
111 }115 }
112116
113 for _, ip := range addrs {117 for _, addr := range addrs {
114 ip := strings.Split(ip.String(), "/")[0]118 ip, _, err := net.ParseCIDR(addr.String())
115 if strings.HasPrefix(ip, "127.") {119 if ip == nil || err != nil || ip.IsLoopback() {
116 continue120 continue
117 }121 }
118122
119123
=== modified file 'build.sh'
--- build.sh 2015-05-26 13:34:13 +0000
+++ build.sh 2015-12-03 08:16:49 +0000
@@ -9,14 +9,17 @@
9 arch=$19 arch=$1
1010
11 case $arch in11 case $arch in
12 386)
13 plat_abi=i386-linux-gnu
14 ;;
12 amd64)15 amd64)
13 plat_abi=x86_64-linux-gnu16 plat_abi=x86_64-linux-gnu
14 ;;17 ;;
15 arm)18 arm)
16 plat_abi=arm-linux-gnueabihf19 plat_abi=arm-linux-gnueabihf
17 ;;20 ;;
18 armhf)21 arm64)
19 plat_abi=arm-linux-gnueabihf22 plat_abi=aarch64-linux-gnu
20 ;;23 ;;
21 *)24 *)
22 echo "unknown platform for snappy-magic: $arch remember to file a bug or better yet: fix it :)"25 echo "unknown platform for snappy-magic: $arch remember to file a bug or better yet: fix it :)"
@@ -28,13 +31,33 @@
28}31}
2932
30gobuild() {33gobuild() {
31 arch=$134 local arch=$1
3235 local plat_abi=$(get_platform_abi $arch)
33 plat_abi=$(get_platform_abi $arch)
3436
35 mkdir -p "bin/$plat_abi"37 mkdir -p "bin/$plat_abi"
36 cd "bin/$plat_abi"38 cd "bin/$plat_abi"
37 GOARCH=$arch GOARM=7 CGO_ENABLED=1 CC=${plat_abi}-gcc go build -ldflags "-extld=${plat_abi}-gcc" launchpad.net/webdm/cmd/snappyd39
40 local GOARCH CGO_ENABLED CC GO386 FLAGS
41
42 export GOARCH=$arch
43 export CGO_ENABLED=1
44
45 if [ "$arch" = "386" ]; then
46 # 386 is a special snowflake, etc
47 # also, the edison doesn't have SSE, which we might care about
48 export GO386=387
49 else
50 export CC=${plat_abi}-gcc
51 if ! which $CC > /dev/null; then
52 echo "Could not find $CC. Maybe you need to install gcc-${plat_abi}?"
53 exit 1
54 fi
55
56 FLAGS="-ldflags -extld=$CC"
57 fi
58
59 go build $FLAGS launchpad.net/webdm/cmd/snappyd
60
38 cd - > /dev/null61 cd - > /dev/null
39}62}
4063
@@ -55,11 +78,14 @@
55cp -r www/public www/templates $builddir/www78cp -r www/public www/templates $builddir/www
56cd $builddir79cd $builddir
5780
58sed -i 's/\(architecture: \)UNKNOWN_ARCH/\1[amd64, armhf]/' \81sed -i 's/\(architectures: \)UNKNOWN_ARCH/\1[i386, amd64, armhf, arm64]/' \
59 $builddir/meta/package.yaml82 $builddir/meta/package.yaml
6083
61gobuild arm84for arch in 386 amd64 arm arm64; do
62gobuild amd6485 echo -n Building for $arch...
86 gobuild $arch
87 echo done
88done
6389
64cd "$orig_pwd"90cd "$orig_pwd"
6591
6692
=== modified file 'dependencies.tsv'
--- dependencies.tsv 2015-05-07 18:53:42 +0000
+++ dependencies.tsv 2015-12-03 08:16:49 +0000
@@ -4,9 +4,11 @@
4github.com/davecheney/mdns git de174d86a3d3e87bfad9cb66cedd0433380b67b0 2014-09-13T23:56:41Z4github.com/davecheney/mdns git de174d86a3d3e87bfad9cb66cedd0433380b67b0 2014-09-13T23:56:41Z
5github.com/gorilla/context git 50c25fb3b2b3b3cc724e9b6ac75fb44b3bccd0da 2014-11-26T16:34:05Z5github.com/gorilla/context git 50c25fb3b2b3b3cc724e9b6ac75fb44b3bccd0da 2014-11-26T16:34:05Z
6github.com/gorilla/mux git e444e69cbd2e2e3e0749a2f3c717cec491552bbf 2014-09-26T15:38:14Z6github.com/gorilla/mux git e444e69cbd2e2e3e0749a2f3c717cec491552bbf 2014-09-26T15:38:14Z
7github.com/juju/loggo git 4c7cbce140ca070eeb59a28f4bf9507e511711f9 2015-02-26T05:51:10Z7github.com/gosexy/gettext git 98b7b91596d20b96909e6b60d57411547dd9959c 2013-02-21T11:21:43Z
8github.com/miekg/dns git 5a357a6fc5e85268b929350aa6423e2d56dcc4ff 2015-04-18T05:52:30Z8github.com/miekg/dns git 5a357a6fc5e85268b929350aa6423e2d56dcc4ff 2015-04-18T05:52:30Z
9github.com/mvo5/goconfigparser git 26426272dda20cc76aa1fa44286dc743d2972fe8 2015-02-12T09:37:50Z9github.com/mvo5/goconfigparser git 26426272dda20cc76aa1fa44286dc743d2972fe8 2015-02-12T09:37:50Z
10github.com/mvo5/uboot-go git 361f6ebcbb54f389d15dc9faefa000e996ba3e37 2015-07-22T06:53:46Z
11github.com/ubuntu-core/snappy git 0b7a98c6dbd4d46c0f548806254ac722e72a2158 2015-11-13T09:05:44Z
10gopkg.in/check.v1 git 64131543e7896d5bcc6bd5a76287eb75ea96c673 2014-10-24T13:38:53Z12gopkg.in/check.v1 git 64131543e7896d5bcc6bd5a76287eb75ea96c673 2014-10-24T13:38:53Z
11gopkg.in/yaml.v2 git 49c95bdc21843256fb6c4e0d370a05f24a0bf213 2015-02-24T22:57:58Z13gopkg.in/yaml.v2 git 49c95bdc21843256fb6c4e0d370a05f24a0bf213 2015-02-24T22:57:58Z
12launchpad.net/snappy bzr snappy_tarmac-20150507103214-pgd90adryua6v6wi 44414launchpad.net/goyaml bzr gustavo@niemeyer.net-20140305200416-7gh64vkcckre5mob 51
1315
=== modified file 'oem/oem.go'
--- oem/oem.go 2015-05-08 19:21:46 +0000
+++ oem/oem.go 2015-12-03 08:16:49 +0000
@@ -22,12 +22,13 @@
22 "io/ioutil"22 "io/ioutil"
23 "path/filepath"23 "path/filepath"
2424
25 "launchpad.net/snappy/snappy"25 "github.com/ubuntu-core/snappy/pkg"
26 "github.com/ubuntu-core/snappy/snappy"
2627
27 "gopkg.in/yaml.v2"28 "gopkg.in/yaml.v2"
28)29)
2930
30// Snap holds the package.yaml for a snappy.SnapTypeOem package.31// Snap holds the package.yaml for a pkg.TypeOem package.
31type Snap struct {32type Snap struct {
32 Name string `yaml:"name" json:"name"`33 Name string `yaml:"name" json:"name"`
33 Vendor string `yaml:"vendor" json:"vendor"`34 Vendor string `yaml:"vendor" json:"vendor"`
@@ -46,7 +47,7 @@
46// ErrNotFound indicates that there is no oem package.47// ErrNotFound indicates that there is no oem package.
47var ErrNotFound = errors.New("no oem package installed")48var ErrNotFound = errors.New("no oem package installed")
4849
49// ErrTooMany indicates that there are too many active snappy.SnapTypeOem packages, which50// ErrTooMany indicates that there are too many active pkg.TypeOem packages, which
50// should never happen on a snappy managed system.51// should never happen on a snappy managed system.
51var ErrTooMany = errors.New("too many oem packages found")52var ErrTooMany = errors.New("too many oem packages found")
5253
@@ -56,7 +57,7 @@
5657
57// Oem returns an oem package58// Oem returns an oem package
58func Oem() (*Snap, error) {59func Oem() (*Snap, error) {
59 oem, err := snappy.ActiveSnapsByType(snappy.SnapTypeOem)60 oem, err := snappy.ActiveSnapsByType(pkg.TypeOem)
60 if err != nil {61 if err != nil {
61 return nil, err62 return nil, err
62 } else if len(oem) > 1 {63 } else if len(oem) > 1 {
6364
=== removed directory 'pkg/meta/hooks'
=== removed file 'pkg/meta/hooks/config'
--- pkg/meta/hooks/config 2015-02-27 16:35:54 +0000
+++ pkg/meta/hooks/config 1970-01-01 00:00:00 +0000
@@ -1,70 +0,0 @@
1#!/usr/bin/python3
2"""python3 hook for webdm"""
3
4import configparser
5import os
6import subprocess
7import sys
8import yaml
9
10
11WEBDM_DATA_PATH = os.environ['SNAP_APP_DATA_PATH']
12WEBDM_VERSION = os.environ['SNAP_VERSION']
13AVAHI_CONFIG_FILE = os.path.join(WEBDM_DATA_PATH, 'avahi-daemon.conf')
14
15def main():
16 """main is the main function"""
17
18 config_yaml = yaml.load(sys.stdin)
19 if config_yaml:
20 avahi_config = set_config(config_yaml)
21
22 with open(AVAHI_CONFIG_FILE, 'w') as config:
23 avahi_config.write(config, space_around_delimiters=False)
24
25 yaml.dump(get_config(), stream=sys.stdout, default_flow_style=False)
26 sys.exit(0)
27
28
29def set_config(config_yaml):
30 """set_config sets a configuration and returns avahi_config"""
31
32 restart_avahi = False
33
34 config = config_yaml['config']['webdm']
35
36 avahi_config = configparser.ConfigParser()
37 avahi_config.read(AVAHI_CONFIG_FILE)
38
39 if 'avahi-hostname' in config:
40 avahi_config['server']['host-name'] = config['avahi-hostname']
41 restart_avahi = True
42
43 if restart_avahi:
44 avahi_unit = 'webdm_avahi_%s.service' % WEBDM_VERSION
45 try:
46 subprocess.check_call(['systemctl', 'restart', avahi_unit])
47 except subprocess.CalledProcessError:
48 print("Cannot restart required services to fully apply "
49 "the configuration changes")
50
51 return avahi_config
52
53
54def get_config():
55 """get_config returns config with the current configuration"""
56
57 config = {}
58 config['config'] = {}
59 config['config']['webdm'] = {}
60
61 avahi_config = configparser.ConfigParser()
62 avahi_config.read(AVAHI_CONFIG_FILE)
63
64 hostname = avahi_config['server']['host-name']
65 config['config']['webdm']['avahi-hostname'] = hostname
66
67 return config
68
69if __name__ == '__main__':
70 main()
710
=== modified file 'pkg/meta/package.yaml'
--- pkg/meta/package.yaml 2015-06-10 14:41:19 +0000
+++ pkg/meta/package.yaml 2015-12-03 08:16:49 +0000
@@ -3,8 +3,8 @@
3icon: meta/webdm-icon.png3icon: meta/webdm-icon.png
4source: lp:webdm4source: lp:webdm
5type: framework5type: framework
6version: 0.96version: "0.11"
7architecture: UNKNOWN_ARCH7architectures: UNKNOWN_ARCH
8services:8services:
9 - name: snappyd9 - name: snappyd
10 start: snappyd10 start: snappyd
1111
=== modified file 'pkg/snappyd'
--- pkg/snappyd 2015-05-21 22:24:32 +0000
+++ pkg/snappyd 2015-12-03 08:16:49 +0000
@@ -4,6 +4,12 @@
4platform=$(uname -i)4platform=$(uname -i)
55
6case $platform in6case $platform in
7 i386)
8 plat_abi=i386-linux-gnu
9 ;;
10 aarch64)
11 plat_abi=aarch64-linux-gnu
12 ;;
7 x86_64)13 x86_64)
8 plat_abi=x86_64-linux-gnu14 plat_abi=x86_64-linux-gnu
9 ;;15 ;;
@@ -15,7 +21,6 @@
15 ;;21 ;;
16esac22esac
1723
18mkdir -m1777 -p $SNAP_APP_TMPDIR
19exec $SNAP_APP_PATH/bin/$plat_abi/snappyd24exec $SNAP_APP_PATH/bin/$plat_abi/snappyd
2025
21# never reach this26# never reach this
2227
=== modified file 'snappy/common_test.go'
--- snappy/common_test.go 2015-05-07 15:37:12 +0000
+++ snappy/common_test.go 2015-12-03 08:16:49 +0000
@@ -20,7 +20,7 @@
20import (20import (
21 "testing"21 "testing"
2222
23 "launchpad.net/snappy/snappy"23 "github.com/ubuntu-core/snappy/snappy"
2424
25 . "gopkg.in/check.v1"25 . "gopkg.in/check.v1"
26)26)
2727
=== modified file 'snappy/converge.go'
--- snappy/converge.go 2015-05-08 15:22:21 +0000
+++ snappy/converge.go 2015-12-03 08:16:49 +0000
@@ -25,7 +25,8 @@
2525
26 "log"26 "log"
2727
28 "launchpad.net/snappy/snappy"28 "github.com/ubuntu-core/snappy/snappy"
29 "github.com/ubuntu-core/snappy/pkg"
29 "launchpad.net/webdm/webprogress"30 "launchpad.net/webdm/webprogress"
30)31)
3132
@@ -43,7 +44,7 @@
43 Progress float64 `json:"progress,omitempty"`44 Progress float64 `json:"progress,omitempty"`
44 InstalledSize int64 `json:"installed_size,omitempty"`45 InstalledSize int64 `json:"installed_size,omitempty"`
45 DownloadSize int64 `json:"download_size,omitempty"`46 DownloadSize int64 `json:"download_size,omitempty"`
46 Type snappy.SnapType `json:"type,omitempty"`47 Type pkg.Type `json:"type,omitempty"`
47 UIPort uint64 `json:"ui_port,omitempty"`48 UIPort uint64 `json:"ui_port,omitempty"`
48 UIUri string `json:"ui_uri,omitempty"`49 UIUri string `json:"ui_uri,omitempty"`
49}50}
@@ -63,10 +64,10 @@
63var activeSnapByName = snappy.ActiveSnapByName64var activeSnapByName = snappy.ActiveSnapByName
6465
65func (h *Handler) packagePayload(resource string) (snapPkg, error) {66func (h *Handler) packagePayload(resource string) (snapPkg, error) {
66 var pkgName, namespace string67 var pkgName, origin string
67 if s := strings.Split(resource, "."); len(s) == 2 {68 if s := strings.Split(resource, "."); len(s) == 2 {
68 pkgName = s[0]69 pkgName = s[0]
69 namespace = s[1]70 origin = s[1]
70 } else {71 } else {
71 pkgName = resource72 pkgName = resource
72 }73 }
@@ -74,13 +75,13 @@
74 snapQ := activeSnapByName(pkgName)75 snapQ := activeSnapByName(pkgName)
75 if snapQ != nil {76 if snapQ != nil {
76 // the second check is for locally installed snaps that lose their origin.77 // the second check is for locally installed snaps that lose their origin.
77 if snapQ.Namespace() == namespace || snapQ.Type() != snappy.SnapTypeApp {78 if snapQ.Origin() == origin || snapQ.Type() != pkg.TypeApp {
78 return h.snapQueryToPayload(snapQ), nil79 return h.snapQueryToPayload(snapQ), nil
79 }80 }
80 }81 }
8182
82 mStore := snappy.NewMetaStoreRepository()83 mStore := snappy.NewMetaStoreRepository()
83 found, err := mStore.Details(resource)84 found, err := mStore.Details(pkgName, origin)
84 if err == nil && len(found) != 0 {85 if err == nil && len(found) != 0 {
85 return h.snapQueryToPayload(found[0]), nil86 return h.snapQueryToPayload(found[0]), nil
86 }87 }
@@ -225,33 +226,24 @@
225 return snapPkgs226 return snapPkgs
226}227}
227228
228func isNamespaceless(snap snappy.Part) bool {
229 return snap.Type() == snappy.SnapTypeOem || snap.Type() == snappy.SnapTypeFramework
230}
231
232func hasPortInformation(snap snappy.Part) bool {229func hasPortInformation(snap snappy.Part) bool {
233 return snap.Type() == snappy.SnapTypeApp || snap.Type() == snappy.SnapTypeFramework230 return snap.Type() == pkg.TypeApp || snap.Type() == pkg.TypeFramework
234}231}
235232
236func (h *Handler) snapQueryToPayload(snapQ snappy.Part) snapPkg {233func (h *Handler) snapQueryToPayload(snapQ snappy.Part) snapPkg {
237 snap := snapPkg{234 snap := snapPkg{
238 Name: snapQ.Name(),235 Name: snapQ.Name(),
239 Origin: snapQ.Namespace(),236 Origin: snapQ.Origin(),
240 Version: snapQ.Version(),237 Version: snapQ.Version(),
241 Vendor: snapQ.Vendor(),238 Vendor: snapQ.Vendor(),
242 Description: snapQ.Description(),239 Description: snapQ.Description(),
243 Type: snapQ.Type(),240 Type: snapQ.Type(),
244 }241 ID: snappy.QualifiedName(snapQ),
245
246 if isNamespaceless(snapQ) {
247 snap.ID = snapQ.Name()
248 } else {
249 snap.ID = snapQ.Name() + "." + snapQ.Namespace()
250 }242 }
251243
252 if hasPortInformation(snapQ) {244 if hasPortInformation(snapQ) {
253 if snapInstalled, ok := snapQ.(snappy.Services); ok {245 if snapInstalled, ok := snapQ.(snappy.ServiceYamler); ok {
254 port, uri := uiAccess(snapInstalled.Services())246 port, uri := uiAccess(snapInstalled.ServiceYamls())
255 snap.UIPort = port247 snap.UIPort = port
256 snap.UIUri = uri248 snap.UIUri = uri
257 }249 }
@@ -293,7 +285,7 @@
293 return snap285 return snap
294}286}
295287
296func uiAccess(services []snappy.Service) (port uint64, uri string) {288func uiAccess(services []snappy.ServiceYaml) (port uint64, uri string) {
297 for i := range services {289 for i := range services {
298 if services[i].Ports == nil {290 if services[i].Ports == nil {
299 continue291 continue
300292
=== modified file 'snappy/converge_test.go'
--- snappy/converge_test.go 2015-05-07 15:37:12 +0000
+++ snappy/converge_test.go 2015-12-03 08:16:49 +0000
@@ -23,7 +23,7 @@
23 "path/filepath"23 "path/filepath"
2424
25 . "gopkg.in/check.v1"25 . "gopkg.in/check.v1"
26 "launchpad.net/snappy/snappy"26 "github.com/ubuntu-core/snappy/snappy"
27 "launchpad.net/webdm/webprogress"27 "launchpad.net/webdm/webprogress"
28)28)
2929
3030
=== modified file 'snappy/handlers.go'
--- snappy/handlers.go 2015-05-08 14:56:30 +0000
+++ snappy/handlers.go 2015-12-03 08:16:49 +0000
@@ -24,7 +24,7 @@
24 "net/http"24 "net/http"
25 "strings"25 "strings"
2626
27 "launchpad.net/snappy/snappy"27 "github.com/ubuntu-core/snappy/snappy"
28 "launchpad.net/webdm/webprogress"28 "launchpad.net/webdm/webprogress"
2929
30 "github.com/gorilla/mux"30 "github.com/gorilla/mux"
3131
=== modified file 'webprogress/meter.go'
--- webprogress/meter.go 2015-05-06 17:14:44 +0000
+++ webprogress/meter.go 2015-12-03 08:16:49 +0000
@@ -17,7 +17,7 @@
1717
18package webprogress18package webprogress
1919
20import "launchpad.net/snappy/progress"20import "github.com/ubuntu-core/snappy/progress"
2121
22// Operation indicates the desired operation to perform22// Operation indicates the desired operation to perform
23type Operation uint23type Operation uint

Subscribers

People subscribed via source and target branches