Skip to content

Commit 97ce5b2

Browse files
author
Matthew Fisher
committed
feat(client): optional drink of choice
1 parent 9460ba5 commit 97ce5b2

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
@@ -1445,7 +1445,9 @@ def ps_scale(self, args):
14451445
for type_num in args.get('<type>=<num>'):
14461446
typ, count = type_num.split('=')
14471447
body.update({typ: int(count)})
1448-
sys.stdout.write('Scaling processes... but first, coffee!\n')
1448+
scaling_cmd = 'Scaling processes... but first, {}!\n'.format(
1449+
os.environ.get('DEIS_DRINK_OF_CHOICE', 'coffee'))
1450+
sys.stdout.write(scaling_cmd)
14491451
sys.stdout.flush()
14501452
try:
14511453
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)