jedelman8/cpal — pull request #22 by IPyandy (2014-04-04 23:02:08+00:00)
Title: Allowed input of username and password + other functionality explained below

Added functionality to input username and password at the command-line.
Only works with eapi, similar method needs to be added to individual
platforms setLogin(self, username, password).

Also allowed for -f or -c to be used if either is entered, fancy
redundancy that was already in argparse, but not being taken advantage
of.
```bash
$ python core/main.py -n 'dev1' -m arista -u admin -p arista -i 10.17.31.51 -c getFacts
{ 'connect_ip': '10.17.31.51',
'cpu_utilization': u'Cpu(s): 10.6%us',
'free_system_memory': 1328268,
'hostname': u'eos-sw01',
'platform': u'DCS-7050T-64-R',
'serial_number': u'JPE133256644',
'system_uptime': u' 2:43',
'total_sytem_memory': 3990500,
'var_name': 'dev',
'vendor': 'arista',
'version': u'4.13.2F'}
```

also renamed args in createDevice(args) to createDevice(p_args), there was a lint error based on the

```python
if __name__ == '__main__':
```

not actually being a function, args was being re-defined in two different global/local spaces.
for some reason getUptime and getPlatform were implemented twice in main.py, deleted the redundancy.

added the optional use of -n which is giving the device being created having a 'name' for obj.

```bash
$ python core/main.py -m arista -u admin -p arista -i 10.17.31.51 -c getFacts
{ 'connect_ip': '10.17.31.51',
'cpu_utilization': u'Cpu(s): 10.6%us',
'free_system_memory': 1328268,
'hostname': u'eos-sw01',
'platform': u'DCS-7050T-64-R',
'serial_number': u'JPE13020644',
'system_uptime': u' 2:50',
'total_sytem_memory': 3990500,
'var_name': 'dev',
'vendor': 'arista',
'version': u'4.13.2F'}
```
```bash
$ python core/main.py -n 'sw1' -m arista -u admin -p arista -i 10.17.31.51 -c getFacts
{ 'connect_ip': '10.17.31.51',
'cpu_utilization': u'Cpu(s): 10.6%us',
'free_system_memory': 1328284,
'hostname': u'eos-sw01',
'platform': u'DCS-7050T-64-R',
'serial_number': u'JPE13020644',
'system_uptime': u' 2:52',
'total_sytem_memory': 3990500,
'var_name': 'sw1',
'vendor': 'arista',
'version': u'4.13.2F'}
```