pi 0.1.34 → 0.1.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README CHANGED
@@ -613,14 +613,6 @@ Available memory: 1536 M, maximum instances: 24
613
613
  Current instance: 1, Instance number: 2
614
614
  Scaling application: ................................Success to scale instances to 2
615
615
 
616
- wangjing@wangjing-pc:~$ pi app-debug 3213
617
- +-------------+------------+---------+
618
- | Debug IP | Debug Port | State |
619
- +-------------+------------+---------+
620
- | 23.22.37.20 | 48175 | RUNNING |
621
- | 23.22.37.20 | 50631 | RUNNING |
622
- +-------------+------------+---------+
623
-
624
616
  wangjing@wangjing-pc:~$ pi status 3213
625
617
  +-------------+---------+--------+-----------+---------+--------------+------------+
626
618
  | Instance ID | Status | CPU(%) | Memory(M) | Disk(M) | RequestCount | ErrorCount |
@@ -271,5 +271,8 @@ module PI::Cli
271
271
  (value =~ /^[^\'\"\\=]{1,18}$/) ? true : false
272
272
  end
273
273
 
274
+ def check_mem_valid?(value)
275
+ (value =~ /((64m)|(128m)|(256m)|(512m)|(1g)|(2g))/i) ? true : false
276
+ end
274
277
  end
275
278
  end
@@ -148,7 +148,17 @@ module PI::Cli::Command
148
148
  url = "#{appname}.#{user[:userName]}.#{target}.samsungpaas.com"
149
149
  display "URL: #{url}"
150
150
  # choose the mem
151
- mem = ask "Memory reservation", :default => DEFAULTS["mem"], :choices => ["64M", "128M", "256M", "512M", "1G", "2G"]
151
+ mem = nil
152
+ loop{
153
+ mem = ask "Memory reservation", :default => DEFAULTS["mem"], :choices => ["64M", "128M", "256M", "512M", "1G", "2G"], :indexed => true unless mem
154
+ if not check_mem_valid?(mem)
155
+ display "Invalid mem value '#{mem}'.".red
156
+ mem = nil
157
+ next
158
+ else
159
+ break
160
+ end
161
+ }
152
162
  # Set to MB number
153
163
  mem_quota = mem_choice_to_quota(mem)
154
164
 
@@ -95,7 +95,7 @@ module PI::Cli::Command
95
95
  end
96
96
  client.check_login_status
97
97
  dns = client.dns
98
- return display "No Services" if dns.nil? || dns.empty?
98
+ return display "No Dns" if dns.nil? || dns.empty?
99
99
  return display JSON.pretty_generate(dns) if @options[:json]
100
100
  dns.sort! {|a, b| a[:name] <=> b[:name] }
101
101
  dns_table = table do |t|
@@ -1,5 +1,5 @@
1
1
  module PI
2
2
  module Cli
3
- VERSION = '0.1.34'
3
+ VERSION = '0.1.35'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pi
3
3
  version: !ruby/object:Gem::Version
4
- hash: 95
4
+ hash: 93
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 34
10
- version: 0.1.34
9
+ - 35
10
+ version: 0.1.35
11
11
  platform: ruby
12
12
  authors:
13
13
  - Samsung
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-12-07 00:00:00 Z
18
+ date: 2012-12-11 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: json_pure