Skip to content

Commit 6cc93ad

Browse files
author
Matthew Fisher
committed
Merge pull request #2393 from bacongobbler/drink_of_choice
feat(client): optional drink of choice
2 parents 48c9ee4 + 97ce5b2 commit 6cc93ad

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

client/deis.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1448,7 +1448,9 @@ def ps_scale(self, args):
14481448
for type_num in args.get('<type>=<num>'):
14491449
typ, count = type_num.split('=')
14501450
body.update({typ: int(count)})
1451-
sys.stdout.write('Scaling processes... but first, coffee!\n')
1451+
scaling_cmd = 'Scaling processes... but first, {}!\n'.format(
1452+
os.environ.get('DEIS_DRINK_OF_CHOICE', 'coffee'))
1453+
sys.stdout.write(scaling_cmd)
14521454
sys.stdout.flush()
14531455
try:
14541456
progress = TextProgress()

tests/ps_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
package tests
44

55
import (
6+
"os"
67
"os/exec"
78
"strings"
89
"testing"
@@ -22,6 +23,12 @@ func TestPs(t *testing.T) {
2223
psListTest(t, params, false)
2324
utils.AppsDestroyTest(t, params)
2425
utils.Execute(t, psScaleCmd, params, true, "404 NOT FOUND")
26+
// ensure we can choose our preferred beverage
27+
utils.Execute(t, psScaleCmd, params, true, "but first, coffee!")
28+
if err := os.Setenv("DEIS_DRINK_OF_CHOICE", "tea"); err != nil {
29+
t.Fatal(err)
30+
}
31+
utils.Execute(t, psScaleCmd, params, true, "but first, tea!")
2532
}
2633

2734
func psSetup(t *testing.T) *utils.DeisTestConfig {

0 commit comments

Comments
 (0)