Skip to content

Commit c39619e

Browse files
author
Nathan Beittenmiller
committed
Renaming other references to CCIs
1 parent b6d5c21 commit c39619e

File tree

17 files changed

+188
-164
lines changed

17 files changed

+188
-164
lines changed

SoftLayer/CLI/modules/filters.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
Examples:
2323
sl server list --datacenter=dal05
2424
sl server list --hostname='prod*'
25-
sl cci list --network=100 --cpu=2
26-
sl cci list --network='< 100' --cpu=2
27-
sl cci list --memory='>= 2048'
25+
sl vs list --network=100 --cpu=2
26+
sl vs list --network='< 100' --cpu=2
27+
sl vs list --memory='>= 2048'
2828
2929
Note: Comparison operators (>, <, >=, <=) can be used with integers, floats,
3030
and strings.

SoftLayer/CLI/modules/sshkey.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@ class ListSshKey(CLIRunnable):
109109
Display a list of SSH keys on your account
110110
111111
Options:
112-
--sortby=ARG Column to sort by. options: datacenter, vlans, subnets, IPs,
113-
networking, hardware, ccis, firewall
112+
--sortby=ARG Column to sort by. options: label, fingerprint, notes
114113
"""
115114
action = 'list'
116115

SoftLayer/CLI/modules/subnet.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ class SubnetDetail(CLIRunnable):
110110
Get detailed information about objects assigned to a particular subnet
111111
112112
Filters:
113-
--no-cci Hide CCI listing
114-
--no-hardware Hide hardware listing
113+
--no-vs, --no-cci Hide virtual server listing
114+
--no-hardware Hide hardware listing
115115
"""
116116
action = 'detail'
117117

@@ -137,18 +137,18 @@ def execute(self, args):
137137
table.add_row(['usable ips',
138138
subnet.get('usableIpAddressCount', blank())])
139139

140-
if not args.get('--no-cci'):
140+
if not args.get('--no-vs'):
141141
if subnet['virtualGuests']:
142-
cci_table = Table(['Hostname', 'Domain', 'IP'])
143-
cci_table.align['Hostname'] = 'r'
144-
cci_table.align['IP'] = 'l'
145-
for cci in subnet['virtualGuests']:
146-
cci_table.add_row([cci['hostname'],
147-
cci['domain'],
148-
cci.get('primaryIpAddress')])
149-
table.add_row(['ccis', cci_table])
142+
vs_table = Table(['Hostname', 'Domain', 'IP'])
143+
vs_table.align['Hostname'] = 'r'
144+
vs_table.align['IP'] = 'l'
145+
for vsi in subnet['virtualGuests']:
146+
vs_table.add_row([vsi['hostname'],
147+
vsi['domain'],
148+
vsi.get('primaryIpAddress')])
149+
table.add_row(['vs', vs_table])
150150
else:
151-
table.add_row(['cci', 'none'])
151+
table.add_row(['vs', 'none'])
152152

153153
if not args.get('--no-hardware'):
154154
if subnet['hardware']:
@@ -173,8 +173,8 @@ class SubnetList(CLIRunnable):
173173
Displays a list of subnets
174174
175175
Options:
176-
--sortby=ARG Column to sort by. options: id, number, datacenter, IPs,
177-
hardware, ccis, networking
176+
--sortby=ARG Column to sort by. options: id, identifier, type, datacenter,
177+
vlan id, IPs, hardware, vs
178178
179179
Filters:
180180
-d DC, --datacenter=DC datacenter shortname (sng01, dal05, ...)
@@ -190,7 +190,7 @@ def execute(self, args):
190190

191191
table = Table([
192192
'id', 'identifier', 'type', 'datacenter', 'vlan id', 'IPs',
193-
'hardware', 'ccis',
193+
'hardware', 'vs',
194194
])
195195
table.sortby = args.get('--sortby') or 'id'
196196

@@ -268,7 +268,7 @@ def execute(self, args):
268268
device_table.align['Value'] = 'l'
269269
if addr_info.get('virtualGuest'):
270270
device = addr_info['virtualGuest']
271-
device_type = 'cci'
271+
device_type = 'vs'
272272
else:
273273
device = addr_info['hardware']
274274
device_type = 'server'

SoftLayer/CLI/modules/summary.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Summary(CLIRunnable):
1717
1818
Options:
1919
--sortby=ARG Column to sort by. options: datacenter, vlans,
20-
subnets, IPs, networking, hardware, ccis, firewall
20+
subnets, IPs, networking, hardware, vs
2121
"""
2222
action = None
2323

@@ -27,7 +27,7 @@ def execute(self, args):
2727

2828
table = Table([
2929
'datacenter', 'vlans', 'subnets', 'IPs', 'networking',
30-
'hardware', 'ccis'
30+
'hardware', 'vs'
3131
])
3232
table.sortby = args.get('--sortby') or 'datacenter'
3333

SoftLayer/CLI/modules/vlan.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ class VlanDetail(CLIRunnable):
2020
Get detailed information about objects assigned to a particular VLAN
2121
2222
Filters:
23-
--no-cci Hide CCI listing
24-
--no-hardware Hide hardware listing
23+
--no-vs, --no-cci Hide virtual server listing
24+
--no-hardware Hide hardware listing
2525
"""
2626
action = 'detail'
2727

@@ -61,18 +61,18 @@ def execute(self, args):
6161

6262
table.add_row(['subnets', subnets])
6363

64-
if not args.get('--no-cci'):
64+
if not args.get('--no-vs'):
6565
if vlan['virtualGuests']:
66-
cci_table = KeyValueTable(['Hostname', 'Domain', 'IP'])
67-
cci_table.align['Hostname'] = 'r'
68-
cci_table.align['IP'] = 'l'
69-
for cci in vlan['virtualGuests']:
70-
cci_table.add_row([cci['hostname'],
71-
cci['domain'],
72-
cci.get('primaryIpAddress')])
73-
table.add_row(['ccis', cci_table])
66+
vs_table = KeyValueTable(['Hostname', 'Domain', 'IP'])
67+
vs_table.align['Hostname'] = 'r'
68+
vs_table.align['IP'] = 'l'
69+
for vsi in vlan['virtualGuests']:
70+
vs_table.add_row([vsi['hostname'],
71+
vsi['domain'],
72+
vsi.get('primaryIpAddress')])
73+
table.add_row(['vs', vs_table])
7474
else:
75-
table.add_row(['cci', 'none'])
75+
table.add_row(['vs', 'none'])
7676

7777
if not args.get('--no-hardware'):
7878
if vlan['hardware']:
@@ -98,7 +98,7 @@ class VlanList(CLIRunnable):
9898
9999
Options:
100100
--sortby=ARG Column to sort by. options: id, number, datacenter, IPs,
101-
hardware, ccis, networking
101+
hardware, vs, networking
102102
103103
Filters:
104104
-d DC, --datacenter=DC datacenter shortname (sng01, dal05, ...)
@@ -111,7 +111,7 @@ def execute(self, args):
111111
mgr = NetworkManager(self.client)
112112

113113
table = Table([
114-
'id', 'number', 'datacenter', 'name', 'IPs', 'hardware', 'ccis',
114+
'id', 'number', 'datacenter', 'name', 'IPs', 'hardware', 'vs',
115115
'networking', 'firewall'
116116
])
117117
table.sortby = args.get('--sortby') or 'id'

SoftLayer/tests/CLI/core_tests.py

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,21 @@
1616

1717
def module_fixture():
1818
"""
19-
usage: sl cci <command> [<args>...] [options]
20-
sl cci [-h | --help]
19+
usage: sl vs <command> [<args>...] [options]
20+
sl vs [-h | --help]
2121
"""
2222

2323

2424
def module_no_command_fixture():
2525
"""
26-
usage: sl cci [<args>...] [options]
27-
sl cci [-h | --help]
26+
usage: sl vs [<args>...] [options]
27+
sl vs [-h | --help]
2828
"""
2929

3030

3131
class submodule_fixture(CLIRunnable):
3232
"""
33-
usage: sl cci list [options]
33+
usage: sl vs list [options]
3434
3535
Options:
3636
--hourly Show hourly instances
@@ -44,7 +44,7 @@ def execute(self, args):
4444
class EnvironmentFixture(Environment):
4545
def __init__(self):
4646
super(EnvironmentFixture, self).__init__()
47-
self.plugins = {'cci': {'list': submodule_fixture}}
47+
self.plugins = {'vs': {'list': submodule_fixture}}
4848
self.aliases = {
4949
'meta': 'metadata',
5050
'my': 'metadata',
@@ -64,35 +64,35 @@ def setUp(self):
6464
self.env.get_module_name = MagicMock()
6565

6666
def test_normal_path(self):
67-
self.env.get_module_name.return_value = 'cci'
67+
self.env.get_module_name.return_value = 'vs'
6868
self.assertRaises(
6969
SystemExit, core.main,
70-
args=['cci', 'list', '--config=path/to/config'],
70+
args=['vs', 'list', '--config=path/to/config'],
7171
env=self.env)
7272
self.assertRaises(
7373
SystemExit, core.main,
74-
args=['cci', 'nope', '--config=path/to/config'], env=self.env)
74+
args=['vs', 'nope', '--config=path/to/config'], env=self.env)
7575
self.assertRaises(
7676
SystemExit, core.main,
77-
args=['cci', 'list', '--format=totallynotvalid'], env=self.env)
77+
args=['vs', 'list', '--format=totallynotvalid'], env=self.env)
7878

7979
@patch('SoftLayer.TimedClient.get_last_calls')
8080
def test_normal_path_with_timings(self, calls_mock):
8181
calls_mock.return_value = [('SERVICE.METHOD', 1000, 0.25)]
82-
self.env.get_module_name.return_value = 'cci'
82+
self.env.get_module_name.return_value = 'vs'
8383
self.assertRaises(
8484
SystemExit, core.main,
85-
args=['cci', 'list', '--config=path/to/config', '--timings'],
85+
args=['vs', 'list', '--config=path/to/config', '--timings'],
8686
env=self.env)
8787
calls_mock.assert_called()
8888

8989
@patch('logging.getLogger')
9090
@patch('logging.StreamHandler')
9191
def test_with_debug(self, stream_handler, logger):
92-
self.env.get_module_name.return_value = 'cci'
92+
self.env.get_module_name.return_value = 'vs'
9393
self.assertRaises(
9494
SystemExit, core.main,
95-
args=['cci', 'list', '--debug=3'],
95+
args=['vs', 'list', '--debug=3'],
9696
env=self.env)
9797
logger().setLevel.assert_called_with(10)
9898
logger().addHandler.assert_called_with(stream_handler())
@@ -105,68 +105,68 @@ def test_invalid_module(self):
105105

106106
def test_module_with_no_command(self):
107107
self.env.plugins = {
108-
'cci': {'list': submodule_fixture, None: submodule_fixture}
108+
'vs': {'list': submodule_fixture, None: submodule_fixture}
109109
}
110-
self.env.get_module_name.return_value = 'cci'
110+
self.env.get_module_name.return_value = 'vs'
111111
self.env.load_module = MagicMock()
112112
self.env.load_module.return_value = module_no_command_fixture
113113
resolver = core.CommandParser(self.env)
114-
command, command_args = resolver.parse(['cci', 'list'])
114+
command, command_args = resolver.parse(['vs', 'list'])
115115
self.assertEqual(submodule_fixture, command)
116116

117117
def test_main(self):
118-
self.env.get_module_name.return_value = 'cci'
118+
self.env.get_module_name.return_value = 'vs'
119119
self.env.plugins = {
120-
'cci': {'list': submodule_fixture}
120+
'vs': {'list': submodule_fixture}
121121
}
122122
self.assertRaises(
123123
SystemExit, core.main,
124-
args=['cci', 'list'],
124+
args=['vs', 'list'],
125125
env=self.env)
126126

127127
def test_help(self):
128128
self.env.get_module_name.return_value = 'help'
129129
self.assertRaises(
130130
SystemExit, core.main,
131-
args=['help', 'cci', '--config=path/to/config'], env=self.env)
131+
args=['help', 'vs', '--config=path/to/config'], env=self.env)
132132

133133
def test_keyboard_interrupt(self):
134134
self.env.get_module_name.side_effect = KeyboardInterrupt
135135
self.assertRaises(
136-
SystemExit, core.main, args=['cci', 'list'], env=self.env)
136+
SystemExit, core.main, args=['vs', 'list'], env=self.env)
137137

138138
def test_abort(self):
139139
self.env.get_module_name.side_effect = CLIAbort('exit!')
140140
self.assertRaises(
141-
SystemExit, core.main, args=['cci', 'list'], env=self.env)
141+
SystemExit, core.main, args=['vs', 'list'], env=self.env)
142142

143143
def test_invalid_module_error(self):
144-
self.env.get_module_name.side_effect = InvalidModule('cci')
144+
self.env.get_module_name.side_effect = InvalidModule('vs')
145145
self.assertRaises(
146-
SystemExit, core.main, args=['cci', 'list'], env=self.env)
146+
SystemExit, core.main, args=['vs', 'list'], env=self.env)
147147

148148
def test_softlayer_error(self):
149149
self.env.get_module_name.side_effect = SoftLayer.SoftLayerError
150150
self.assertRaises(
151-
SystemExit, core.main, args=['cci', 'list'], env=self.env)
151+
SystemExit, core.main, args=['vs', 'list'], env=self.env)
152152

153153
def test_softlayer_api_error(self):
154154
error = SoftLayer.SoftLayerAPIError('Exception', 'Exception Text')
155155
self.env.get_module_name.side_effect = error
156156
self.assertRaises(
157-
SystemExit, core.main, args=['cci', 'list'], env=self.env)
157+
SystemExit, core.main, args=['vs', 'list'], env=self.env)
158158

159159
def test_softlayer_api_error_authentication_error(self):
160160
error = SoftLayer.SoftLayerAPIError('SoftLayerException',
161161
'Invalid API Token')
162162
self.env.get_module_name.side_effect = error
163163
self.assertRaises(
164-
SystemExit, core.main, args=['cci', 'list'], env=self.env)
164+
SystemExit, core.main, args=['vs', 'list'], env=self.env)
165165

166166
def test_system_exit_error(self):
167167
self.env.get_module_name.side_effect = SystemExit
168168
self.assertRaises(
169-
SystemExit, core.main, args=['cci', 'list'], env=self.env)
169+
SystemExit, core.main, args=['vs', 'list'], env=self.env)
170170

171171
@patch('traceback.format_exc')
172172
def test_uncaught_error(self, m):
@@ -177,7 +177,7 @@ def test_uncaught_error(self, m):
177177
m.return_value = 'testing'
178178
self.env.get_module_name.side_effect = err
179179
self.assertRaises(
180-
SystemExit, core.main, args=['cci', 'list'], env=self.env)
180+
SystemExit, core.main, args=['vs', 'list'], env=self.env)
181181
m.assert_called_once_with()
182182

183183

@@ -188,10 +188,10 @@ def setUp(self):
188188

189189
def test_main(self,):
190190
args = self.parser.parse_main_args(
191-
args=['cci', 'list'])
191+
args=['vs', 'list'])
192192

193193
self.assertEqual(args['help'], False)
194-
self.assertEqual(args['<module>'], 'cci')
194+
self.assertEqual(args['<module>'], 'vs')
195195
self.assertEqual(args['<args>'], ['list'])
196196

197197
def test_primary_help(self):
@@ -231,13 +231,13 @@ def test_primary_help(self):
231231
@patch('sys.stdout.isatty', return_value=True)
232232
def test_tty(self, tty):
233233
self.assertRaises(
234-
SystemExit, self.parser.parse_command_args, 'cci', 'list', [])
234+
SystemExit, self.parser.parse_command_args, 'vs', 'list', [])
235235

236236
def test_confirm(self):
237237
command = MagicMock()
238238
command.options = ['confirm']
239-
command.__doc__ = 'usage: sl cci list [options]'
239+
command.__doc__ = 'usage: sl vs list [options]'
240240
self.env.get_command = MagicMock()
241241
self.env.get_command.return_value = command
242242
self.assertRaises(
243-
SystemExit, self.parser.parse_command_args, 'cci', 'list', [])
243+
SystemExit, self.parser.parse_command_args, 'vs', 'list', [])

SoftLayer/tests/CLI/helper_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ def test_template_not_exists(self):
370370
{'--template': path})
371371

372372
def test_template_options(self):
373-
path = os.path.join(FIXTURE_PATH, 'sample_cci_template.conf')
373+
path = os.path.join(FIXTURE_PATH, 'sample_vs_template.conf')
374374
args = {
375375
'key': 'value',
376376
'--cpu': None,

0 commit comments

Comments
 (0)