Skip to content
This repository was archived by the owner on Jul 28, 2020. It is now read-only.

Commit eff10ea

Browse files
author
Andy Voellmer
committed
edited not-enough-memory error messages
1 parent cdd1ba4 commit eff10ea

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

cmd/start/start.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -420,27 +420,27 @@ func (s *Start) allocateMemory(isoConfig iso.Metadata, requestedMem int) (int, e
420420
}
421421

422422
if availableMem < uint64(requestedMem) {
423-
s.UI.Say("WARNING: This machine does not have enough available RAM to run with what is specified.")
423+
s.UI.Say("WARNING: This machine may not have enough available RAM to run with what is specified.")
424424
return requestedMem, nil
425425
}
426426
}
427427

428428
if requestedMem < baseMem {
429-
s.UI.Say(fmt.Sprintf("WARNING: It is recommended that you run %s Dev with at least %v MB of RAM", strings.ToUpper(isoConfig.DeploymentName), baseMem))
429+
s.UI.Say(fmt.Sprintf("WARNING: It is recommended that you run %s Dev with at least %v MB of RAM.", strings.ToUpper(isoConfig.DeploymentName), baseMem))
430430
if availableMem >= uint64(requestedMem) {
431431
return requestedMem, nil
432432
}
433433

434434
if availableMem < uint64(requestedMem) {
435-
s.UI.Say("WARNING: This machine does not have enough available RAM to run with what is specified.")
435+
s.UI.Say("WARNING: This machine may not have enough available RAM to run with what is specified.")
436436
return requestedMem, nil
437437
}
438438
}
439439
} else {
440440
if availableMem >= uint64(baseMem) {
441441
return baseMem, nil
442442
} else {
443-
s.UI.Say("WARNING: This machine does not have enough available RAM to run with what is specified.")
443+
s.UI.Say(fmt.Sprintf("WARNING: %s Dev requires %v MB of RAM to run. This machine may not have enough free RAM.", strings.ToUpper(isoConfig.DeploymentName), baseMem))
444444
return baseMem, nil
445445
}
446446
}

cmd/start/start_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ var _ = Describe("Start", func() {
434434
}),
435435
mockIsoReader.EXPECT().Read(depsIsoPath).Return(metadata, nil),
436436
mockSystemProfiler.EXPECT().GetAvailableMemory().Return(uint64(1000), nil),
437-
mockUI.EXPECT().Say("WARNING: This machine does not have enough available RAM to run with what is specified."),
437+
mockUI.EXPECT().Say("WARNING: CF Dev requires 8765 MB of RAM to run. This machine may not have enough free RAM."),
438438
mockUI.EXPECT().Say("Creating the VM..."),
439439
mockHypervisor.EXPECT().CreateVM(hypervisor.VM{
440440
Name: "cfdev",
@@ -500,7 +500,7 @@ var _ = Describe("Start", func() {
500500
}),
501501
mockIsoReader.EXPECT().Read(depsIsoPath).Return(metadata, nil),
502502
mockSystemProfiler.EXPECT().GetAvailableMemory().Return(uint64(10000), nil),
503-
mockUI.EXPECT().Say("WARNING: It is recommended that you run CF Dev with at least 8765 MB of RAM"),
503+
mockUI.EXPECT().Say("WARNING: It is recommended that you run CF Dev with at least 8765 MB of RAM."),
504504
mockUI.EXPECT().Say("Creating the VM..."),
505505
mockHypervisor.EXPECT().CreateVM(hypervisor.VM{
506506
Name: "cfdev",
@@ -623,7 +623,7 @@ var _ = Describe("Start", func() {
623623
}),
624624
mockIsoReader.EXPECT().Read(depsIsoPath).Return(metadata, nil),
625625
mockSystemProfiler.EXPECT().GetAvailableMemory().Return(uint64(1200), nil),
626-
mockUI.EXPECT().Say("WARNING: This machine does not have enough available RAM to run with what is specified."),
626+
mockUI.EXPECT().Say("WARNING: This machine may not have enough available RAM to run with what is specified."),
627627
mockUI.EXPECT().Say("Creating the VM..."),
628628
mockHypervisor.EXPECT().CreateVM(hypervisor.VM{
629629
Name: "cfdev",
@@ -661,7 +661,7 @@ var _ = Describe("Start", func() {
661661
})
662662

663663
Context("and requested memory < base memory", func() {
664-
Context("available mem >= REQUESTED mem", func() {
664+
Context("available memory >= requested memory", func() {
665665
It("starts with warning", func() {
666666
if runtime.GOOS == "darwin" {
667667
mockUI.EXPECT().Say("Installing cfdevd network helper...")
@@ -695,7 +695,7 @@ var _ = Describe("Start", func() {
695695
Services: services,
696696
}, nil),
697697
mockSystemProfiler.EXPECT().GetAvailableMemory().Return(uint64(15000), nil),
698-
mockUI.EXPECT().Say("WARNING: It is recommended that you run PCF Dev with at least 8765 MB of RAM"),
698+
mockUI.EXPECT().Say("WARNING: It is recommended that you run PCF Dev with at least 8765 MB of RAM."),
699699
mockUI.EXPECT().Say("Creating the VM..."),
700700
mockHypervisor.EXPECT().CreateVM(hypervisor.VM{
701701
Name: "cfdev",
@@ -731,7 +731,7 @@ var _ = Describe("Start", func() {
731731
})
732732

733733
Context("and available mem < requested mem", func() {
734-
It("gives two warnings but starts anyway", func() {
734+
It("gives two warnings but starts anyways", func() {
735735
if runtime.GOOS == "darwin" {
736736
mockUI.EXPECT().Say("Installing cfdevd network helper...")
737737
mockCFDevD.EXPECT().Install()
@@ -759,8 +759,8 @@ var _ = Describe("Start", func() {
759759
}),
760760
mockIsoReader.EXPECT().Read(depsIsoPath).Return(metadata, nil),
761761
mockSystemProfiler.EXPECT().GetAvailableMemory().Return(uint64(1200), nil),
762-
mockUI.EXPECT().Say("WARNING: It is recommended that you run CF Dev with at least 8765 MB of RAM"),
763-
mockUI.EXPECT().Say("WARNING: This machine does not have enough available RAM to run with what is specified."),
762+
mockUI.EXPECT().Say("WARNING: It is recommended that you run CF Dev with at least 8765 MB of RAM."),
763+
mockUI.EXPECT().Say("WARNING: This machine may not have enough available RAM to run with what is specified."),
764764
mockUI.EXPECT().Say("Creating the VM..."),
765765
mockHypervisor.EXPECT().CreateVM(hypervisor.VM{
766766
Name: "cfdev",
@@ -1050,7 +1050,7 @@ var _ = Describe("Start", func() {
10501050
}),
10511051
mockIsoReader.EXPECT().Read(customIso).Return(metadata, nil),
10521052
mockSystemProfiler.EXPECT().GetAvailableMemory().Return(uint64(10000), nil),
1053-
mockUI.EXPECT().Say("WARNING: It is recommended that you run CF Dev with at least 8765 MB of RAM"),
1053+
mockUI.EXPECT().Say("WARNING: It is recommended that you run CF Dev with at least 8765 MB of RAM."),
10541054
mockUI.EXPECT().Say("Creating the VM..."),
10551055
mockHypervisor.EXPECT().CreateVM(hypervisor.VM{
10561056
Name: "cfdev",

0 commit comments

Comments
 (0)