Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
Choose a Base Repository
juju/juju
18m-ltc/juju
1stvamp/juju
4a6f656c/juju
AdamIsrael/juju
AlexisBruemmer/juju
Argon-/juju
BryanQuigley/juju
CNXTEoEorg/juju
CSRedRat/juju
DarkDare/juju
Eeemil/juju
ExternalReality/juju
JAYSNVA/juju
KnightSecretShop/juju
LinuxDoom/juju
LinuxEntrepreneur/juju
MG-Akbar/juju
MuharremOkutan/juju
Pankov404/juju
Pekkari/juju
ProgrammerAndHacker/juju
Stasonhub/juju
Veebers/juju
abentley/juju
alesstimec/juju
allomov/juju
anastasiamac/juju
andrewdmcleod/juju
arunsingh/juju
ateleshev/juju
atombender/juju
axw/juju
aznashwan/juju
babbageclunk/juju
bac/juju
battlemidget/juju
bcsaller/juju
benileo/juju
bigsurge/juju
binary132/juju
bkuschel/juju
bloodearnest/juju
bogdanteleaga/juju
bpattewar/juju
brianalbrecht/juju
bryanl/juju
bz2/juju
ccoblis/juju
cherylj/juju
cholcombe973/juju-1
chrisglass/juju
chrisjohnston/juju
cmars/juju
dardevelin/juju
davecheney/juju
deanmaniatis/juju
devigned/juju
didrocks/juju
dimitern/juju
dooferlad/juju
dougparrish/juju
dpb1/juju
dshcherb/juju
elopio/juju
ericsnowcurrently/juju
evandandrea/juju
evilnick/juju
exekias/juju
fabricematrat/juju
felicianotech/juju
fnordahl/juju
frankban/juju
freyes/juju
frobware/juju
fwereade/juju
gabriel-samfira/juju
gitqueue/juju
gnuoy/juju
gooops/juju
hamsterksu/juju
hartsock/juju
hbcbh1999/juju
hoenirvili/juju
howbazaar/juju
imoapps/juju
ip-2014/juju
ipedrazas/juju
jameinel/juju
jiasir/juju
jimmiebtlr/juju
jisanB/juju
jjo/juju
jogeo/juju
johnsca/juju
jolestar/juju
jrwren/juju
julianwang/juju
junaid-ali/juju
jwood1/juju
kakamessi99/juju
kambyarthur/juju
kapilt/juju
kat-co/juju
kazishariar/juju
kevinnguyeneng/juju
khanchan/juju
kinganeng/juju
klyachin/juju
kryptBlue/juju
ktsakalozos/juju
leobcn/juju
linearregression/juju
lingo-reviews/juju
linux-days/juju
lucciano/juju
macduff23/juju
macgreagoir/juju
makyo/juju
marcmolla/juju
marcoceppi/juju
mattyw/juju
maximp/juju-cloudsigma
mbruzek/juju
mhilton/juju-juju
michaelkrumpe/juju
mikeaddison93/juju
mikemccracken/juju
mitechie/juju
mjs/juju
mwhudson/juju
niedbalski/juju
nobuto-m/juju
ns950/juju
optimuse/juju
packethost/juju
pdaniel-frk/juju
perrito666/juju
pmatulis/juju
pombredanne/juju
prevosis/juju
punalpatel/juju
radoslavsandov/juju
raghucse2010/juju
rastaman/juju
reddydodda/juju
reedobrien/juju
rgardler/juju
rhalff/juju
rogpeppe/juju
rowhit/juju
sagardeyrakesh/juju
samiujan/juju
sarkartanzil/juju
saydulk/juju
sean-jc/juju
sebastienpattyn93/juju
seman/juju
sfrias/juju
sidnei/juju
simonklb/juju
simudream/juju
sinzui/juju
snailwalker/juju
stgraber/juju
stub42/juju
sweetcard/juju
t0mk/juju
tasdomas/juju
tedmcox/juju
tekny/juju
th3architect/juju
thabo104/juju
theosotr/juju
thomnico/juju
tomzhang/juju
trobert2/juju
tvansteenburgh/juju
tych0/juju
uk702/juju
urosj/juju
vijaytripathi/juju
voidspace/juju
vonwenm/juju
vtapia/juju
waigani/juju
wallyworld/juju
wangmingjob/juju
watonyweng/juju
whitmo/juju
wolsen/juju
wupeka/juju
wwitzel3/juju
xiaoqing-wei/juju
xnox/juju
xushiwei/juju
yeer911/juju
zbyufei/juju
zeiv/juju
zhoutiekui/juju
Nothing to show
...
Choose a Head Repository
juju/juju
18m-ltc/juju
1stvamp/juju
4a6f656c/juju
AdamIsrael/juju
AlexisBruemmer/juju
Argon-/juju
BryanQuigley/juju
CNXTEoEorg/juju
CSRedRat/juju
DarkDare/juju
Eeemil/juju
ExternalReality/juju
JAYSNVA/juju
KnightSecretShop/juju
LinuxDoom/juju
LinuxEntrepreneur/juju
MG-Akbar/juju
MuharremOkutan/juju
Pankov404/juju
Pekkari/juju
ProgrammerAndHacker/juju
Stasonhub/juju
Veebers/juju
abentley/juju
alesstimec/juju
allomov/juju
anastasiamac/juju
andrewdmcleod/juju
arunsingh/juju
ateleshev/juju
atombender/juju
axw/juju
aznashwan/juju
babbageclunk/juju
bac/juju
battlemidget/juju
bcsaller/juju
benileo/juju
bigsurge/juju
binary132/juju
bkuschel/juju
bloodearnest/juju
bogdanteleaga/juju
bpattewar/juju
brianalbrecht/juju
bryanl/juju
bz2/juju
ccoblis/juju
cherylj/juju
cholcombe973/juju-1
chrisglass/juju
chrisjohnston/juju
cmars/juju
dardevelin/juju
davecheney/juju
deanmaniatis/juju
devigned/juju
didrocks/juju
dimitern/juju
dooferlad/juju
dougparrish/juju
dpb1/juju
dshcherb/juju
elopio/juju
ericsnowcurrently/juju
evandandrea/juju
evilnick/juju
exekias/juju
fabricematrat/juju
felicianotech/juju
fnordahl/juju
frankban/juju
freyes/juju
frobware/juju
fwereade/juju
gabriel-samfira/juju
gitqueue/juju
gnuoy/juju
gooops/juju
hamsterksu/juju
hartsock/juju
hbcbh1999/juju
hoenirvili/juju
howbazaar/juju
imoapps/juju
ip-2014/juju
ipedrazas/juju
jameinel/juju
jiasir/juju
jimmiebtlr/juju
jisanB/juju
jjo/juju
jogeo/juju
johnsca/juju
jolestar/juju
jrwren/juju
julianwang/juju
junaid-ali/juju
jwood1/juju
kakamessi99/juju
kambyarthur/juju
kapilt/juju
kat-co/juju
kazishariar/juju
kevinnguyeneng/juju
khanchan/juju
kinganeng/juju
klyachin/juju
kryptBlue/juju
ktsakalozos/juju
leobcn/juju
linearregression/juju
lingo-reviews/juju
linux-days/juju
lucciano/juju
macduff23/juju
macgreagoir/juju
makyo/juju
marcmolla/juju
marcoceppi/juju
mattyw/juju
maximp/juju-cloudsigma
mbruzek/juju
mhilton/juju-juju
michaelkrumpe/juju
mikeaddison93/juju
mikemccracken/juju
mitechie/juju
mjs/juju
mwhudson/juju
niedbalski/juju
nobuto-m/juju
ns950/juju
optimuse/juju
packethost/juju
pdaniel-frk/juju
perrito666/juju
pmatulis/juju
pombredanne/juju
prevosis/juju
punalpatel/juju
radoslavsandov/juju
raghucse2010/juju
rastaman/juju
reddydodda/juju
reedobrien/juju
rgardler/juju
rhalff/juju
rogpeppe/juju
rowhit/juju
sagardeyrakesh/juju
samiujan/juju
sarkartanzil/juju
saydulk/juju
sean-jc/juju
sebastienpattyn93/juju
seman/juju
sfrias/juju
sidnei/juju
simonklb/juju
simudream/juju
sinzui/juju
snailwalker/juju
stgraber/juju
stub42/juju
sweetcard/juju
t0mk/juju
tasdomas/juju
tedmcox/juju
tekny/juju
th3architect/juju
thabo104/juju
theosotr/juju
thomnico/juju
tomzhang/juju
trobert2/juju
tvansteenburgh/juju
tych0/juju
uk702/juju
urosj/juju
vijaytripathi/juju
voidspace/juju
vonwenm/juju
vtapia/juju
waigani/juju
wallyworld/juju
wangmingjob/juju
watonyweng/juju
whitmo/juju
wolsen/juju
wupeka/juju
wwitzel3/juju
xiaoqing-wei/juju
xnox/juju
xushiwei/juju
yeer911/juju
zbyufei/juju
zeiv/juju
zhoutiekui/juju
Nothing to show
Choose a head branch
1.21
1.22
012-charm-v2
022-simplify-deploy
aaa2
admin-login-readonly
bootstrap-tests
bootstrap-usage
bundle-add-services
bundle-annotation-new
bundle-facade
bundle-handle-annotations
bundle-handle-relations
bundle-local-file
bundle-set-annotations
bundle-units-and-machines
bunlde-annotations
changes-endpoint-fixes
changes-endpoint
charminfo-with-metrics
charmstore-api-v4
chicago-cubs
client-model-info-perms
cmd-environment-jenv
constraints-string
controller-template
cross-model-relations
deploy-auth
deploy-bundle-base
deploy-bundle-expose-services
deploy-bundle
develop
embedded-gui
environment-uuid-revision-updater
external-mgosuite
fix-1513236
fix-charmrevisionupdater
fix-macaroon-login
gui-addr-from-controller
gui-address-from-controller
gui-command
gui-controller-address
gui-controller
gui-embedded-prototype
gui-gzip-compression
gui-in-simplestreams
gui-info
gui-initial-http-handler
gui-simplestreams-envvar
gui-static-url
gui-test-fixes
gui-version-api
guibundles
http-out
improve-deployment-error-handling
improve-gui-handler
improve-upgrade-gui-output
initial-gui-http-handler
initial-upload
juju-gui-command-improvements
local-charm-default-icon
master
megawatcher-ports-null-backport-1.21
megawatcher-ports-null-backport-1.22
megawatcher-ports-null
merge-master-1
merge-master-1456751698
merge-master-1457957154
merge-master-1457972579
merge-master-1458211059
merge-master-1458682619
merge-master-1459236352
merge-master-1459262858
merge-master-1459771953
merge-master-1460048460
more-gui-api
more-test-fixes
new-bundle-changes-format
new-bundlechanges
new-channels
proto-gui-simplestreams
remove-chaarmstore-auth
remove-charmstore-auth
remove-charmstore-commands
remove-fake-home-suite
remove-names
remove-schema
restore-megawatcher-unit-ports
safe-rename
save-gui
sla-in-model-info
staging
store-external
store-testing
subordinate-info
support-bundles
unstable-packages
update-bundlechanges-dep
update-names
update-pat
upgrade-gui-command
upgrade-gui-from-simplestreams
upgrade-gui-simplestream
upgrade-gui-without-models
use-charm-v5-unstable
validate-deploy-flags
version-exp
windows-attempt
workload-version
Nothing to show
Checking mergeability… Don’t worry, you can still create the pull request.
  • 1 commit
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Commits on Feb 06, 2015
Showing with 17 additions and 2 deletions.
  1. +16 −1 state/megawatcher.go
  2. +1 −1 state/multiwatcher/multiwatcher.go
View
@@ -11,6 +11,7 @@ import (
"github.com/juju/errors"
"gopkg.in/mgo.v2"
+ "github.com/juju/juju/network"
"github.com/juju/juju/state/multiwatcher"
"github.com/juju/juju/state/watcher"
)
@@ -105,7 +106,6 @@ func (u *backingUnit) updated(st *State, store *multiwatcherStore, id interface{
Service: u.Service,
Series: u.Series,
MachineId: u.MachineId,
- Ports: u.Ports,
Subordinate: u.Principal != "",
}
if u.CharmURL != nil {
@@ -134,10 +134,25 @@ func (u *backingUnit) updated(st *State, store *multiwatcherStore, id interface{
}
info.PublicAddress = publicAddress
info.PrivateAddress = privateAddress
+ portRanges, err := getUnitPortRanges(st, u.Name)
+ if err != nil {
+ return err
+ }
+ info.Ports = portRanges
store.Update(info)
return nil
}
+// getUnitPortRanges returns a slice containing the open port ranges of the
+// unit with the given unitName.
+func getUnitPortRanges(st *State, unitName string) ([]network.PortRange, error) {
+ u, err := st.Unit(unitName)
+ if err != nil {
+ return nil, err
+ }
+ return u.OpenedPorts()
+}
+
// getUnitAddresses returns the public and private addresses on a given unit.
// As of 1.18, the addresses are stored on the assigned machine but we retain
// this approach for backwards compatibility.
@@ -169,7 +169,7 @@ type UnitInfo struct {
PublicAddress string
PrivateAddress string
MachineId string
- Ports []network.Port
+ Ports []network.PortRange
Status Status
StatusInfo string
StatusData map[string]interface{}

No commit comments for this range