Skip to content

Commit

Permalink
Merge branch 'release/v2.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
glennmatthews committed Feb 18, 2019
2 parents 01b1446 + 8548f65 commit cf08987
Show file tree
Hide file tree
Showing 31 changed files with 248 additions and 53 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ sudo: false
language: python
python:
- 2.7
- 3.3
- 3.4
- 3.5
- 3.6
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@ Change Log
All notable changes to the COT project will be documented in this file.
This project adheres to `Semantic Versioning`_.

`2.2.0`_ - 2019-02-18
---------------------

**Added**

- COT now recognizes and validates the Cisco C9800-CL platform.

**Removed**

- Discontinued support for Python 3.3 as it has been retired since 2017.

`2.1.0`_ - 2018-01-29
---------------------

Expand Down Expand Up @@ -858,6 +869,7 @@ Initial public release.
.. _verboselogs: https://verboselogs.readthedocs.io/en/latest/

.. _Unreleased: https://github.com/glennmatthews/cot/compare/master...develop
.. _2.2.0: https://github.com/glennmatthews/cot/compare/v2.1.0...v2.2.0
.. _2.1.0: https://github.com/glennmatthews/cot/compare/v2.0.5...v2.1.0
.. _2.0.5: https://github.com/glennmatthews/cot/compare/v2.0.4...v2.0.5
.. _2.0.4: https://github.com/glennmatthews/cot/compare/v2.0.3...v2.0.4
Expand Down
3 changes: 2 additions & 1 deletion COPYRIGHT.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Common OVF Tool (COT)

Copyright (c) 2013-2018 by the following developers:
Copyright (c) 2013-2019 by the following developers:
Glenn F. Matthews
Kevin A. Keim
Quol Fontana
Jusheng Feng
Subba Srinivas
4 changes: 2 additions & 2 deletions COT/commands/add_disk.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# add_disk.py - Implements "cot add-disk" command
#
# August 2013, Glenn F. Matthews
# Copyright (c) 2013-2018 the COT project developers.
# Copyright (c) 2013-2019 the COT project developers.
# See the COPYRIGHT.txt file at the top-level directory of this distribution
# and at https://github.com/glennmatthews/cot/blob/master/COPYRIGHT.txt.
#
Expand Down Expand Up @@ -150,7 +150,7 @@ def disk_image(self, value):

@property
def address(self):
"""Disk device address on controller (``1:0``, etc.).
"""Disk device address on controller (:code:`1:0`, etc.).
Raises:
InvalidInputError: see :meth:`validate_controller_address`
Expand Down
4 changes: 2 additions & 2 deletions COT/commands/tests/command_testcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# command_testcase.py - base class for Command test cases
#
# March 2017, Glenn F. Matthews
# Copyright (c) 2013-2017 the COT project developers.
# Copyright (c) 2013-2017, 2019 the COT project developers.
# See the COPYRIGHT.txt file at the top-level directory of this distribution
# and at https://github.com/glennmatthews/cot/blob/master/COPYRIGHT.txt.
#
Expand All @@ -26,7 +26,7 @@
import StringIO
except ImportError:
# Python 3.x
import io as StringIO
import io as StringIO # noqa: N812

from COT.tests import COTTestCase
from COT.ui import UI
Expand Down
4 changes: 2 additions & 2 deletions COT/docs/man/cot-add-disk.1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "COT-ADD-DISK" "1" "Jan 29, 2018" "2.1.0" "Common OVF Tool (COT)"
.TH "COT-ADD-DISK" "1" "Feb 18, 2019" "2.2.0" "Common OVF Tool (COT)"
.SH NAME
cot-add-disk \- Add or replace a disk image in an OVF or OVA
.
Expand Down Expand Up @@ -116,6 +116,6 @@ Name of this disk (default: "Hard disk #" or
.SH AUTHOR
Glenn F. Matthews
.SH COPYRIGHT
2013-2018, the COT project developers
2013-2019, the COT project developers
.\" Generated by docutils manpage writer.
.
4 changes: 2 additions & 2 deletions COT/docs/man/cot-add-file.1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "COT-ADD-FILE" "1" "Jan 29, 2018" "2.1.0" "Common OVF Tool (COT)"
.TH "COT-ADD-FILE" "1" "Feb 18, 2019" "2.2.0" "Common OVF Tool (COT)"
.SH NAME
cot-add-file \- Add or replace a file in an OVF or OVA
.
Expand Down Expand Up @@ -76,6 +76,6 @@ same as filename)
.SH AUTHOR
Glenn F. Matthews
.SH COPYRIGHT
2013-2018, the COT project developers
2013-2019, the COT project developers
.\" Generated by docutils manpage writer.
.
4 changes: 2 additions & 2 deletions COT/docs/man/cot-deploy-esxi.1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "COT-DEPLOY-ESXI" "1" "Jan 29, 2018" "2.1.0" "Common OVF Tool (COT)"
.TH "COT-DEPLOY-ESXI" "1" "Feb 18, 2019" "2.2.0" "Common OVF Tool (COT)"
.SH NAME
cot-deploy-esxi \- Deploy an OVF or OVA to ESXi, VMware vSphere, or VMware vCenter
.
Expand Down Expand Up @@ -176,6 +176,6 @@ cot deploy foo.ova esxi 192.0.2.100 \-u admin \-p password \e
.SH AUTHOR
Kevin A. Keim, Glenn F. Matthews
.SH COPYRIGHT
2013-2018, the COT project developers
2013-2019, the COT project developers
.\" Generated by docutils manpage writer.
.
4 changes: 2 additions & 2 deletions COT/docs/man/cot-deploy.1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "COT-DEPLOY" "1" "Jan 29, 2018" "2.1.0" "Common OVF Tool (COT)"
.TH "COT-DEPLOY" "1" "Feb 18, 2019" "2.2.0" "Common OVF Tool (COT)"
.SH NAME
cot-deploy \- Deploy an OVF or OVA to create a virtual machine
.
Expand Down Expand Up @@ -69,6 +69,6 @@ Deploy to ESXi, vSphere, or vCenter
.SH AUTHOR
Kevin A. Keim, Glenn F. Matthews
.SH COPYRIGHT
2013-2018, the COT project developers
2013-2019, the COT project developers
.\" Generated by docutils manpage writer.
.
4 changes: 2 additions & 2 deletions COT/docs/man/cot-edit-hardware.1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "COT-EDIT-HARDWARE" "1" "Jan 29, 2018" "2.1.0" "Common OVF Tool (COT)"
.TH "COT-EDIT-HARDWARE" "1" "Feb 18, 2019" "2.2.0" "Common OVF Tool (COT)"
.SH NAME
cot-edit-hardware \- Edit hardware properties and configuration profiles of an OVF or OVA
.
Expand Down Expand Up @@ -215,6 +215,6 @@ cot edit\-hardware input.ova \-o output.ova \-\-nic\-names "mgmt" \e
.SH AUTHOR
Glenn F. Matthews
.SH COPYRIGHT
2013-2018, the COT project developers
2013-2019, the COT project developers
.\" Generated by docutils manpage writer.
.
4 changes: 2 additions & 2 deletions COT/docs/man/cot-edit-product.1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "COT-EDIT-PRODUCT" "1" "Jan 29, 2018" "2.1.0" "Common OVF Tool (COT)"
.TH "COT-EDIT-PRODUCT" "1" "Feb 18, 2019" "2.2.0" "Common OVF Tool (COT)"
.SH NAME
cot-edit-product \- Edit OVF/OVA product information such as version strings
.
Expand Down Expand Up @@ -97,6 +97,6 @@ Application URL, such as
.SH AUTHOR
Glenn F. Matthews
.SH COPYRIGHT
2013-2018, the COT project developers
2013-2019, the COT project developers
.\" Generated by docutils manpage writer.
.
4 changes: 2 additions & 2 deletions COT/docs/man/cot-edit-properties.1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "COT-EDIT-PROPERTIES" "1" "Jan 29, 2018" "2.1.0" "Common OVF Tool (COT)"
.TH "COT-EDIT-PROPERTIES" "1" "Feb 18, 2019" "2.2.0" "Common OVF Tool (COT)"
.SH NAME
cot-edit-properties \- Configure environment properties for an OVF or OVA
.
Expand Down Expand Up @@ -158,6 +158,6 @@ cot edit\-properties input.ovf \-p hostname \-l "Hostname" \e
.SH AUTHOR
Glenn F. Matthews
.SH COPYRIGHT
2013-2018, the COT project developers
2013-2019, the COT project developers
.\" Generated by docutils manpage writer.
.
4 changes: 2 additions & 2 deletions COT/docs/man/cot-info.1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "COT-INFO" "1" "Jan 29, 2018" "2.1.0" "Common OVF Tool (COT)"
.TH "COT-INFO" "1" "Feb 18, 2019" "2.2.0" "Common OVF Tool (COT)"
.SH NAME
cot-info \- Summarize the contents of OVF(s) and/or OVA(s)
.
Expand Down Expand Up @@ -69,6 +69,6 @@ Verbose output (longer)
.SH AUTHOR
Glenn F. Matthews
.SH COPYRIGHT
2013-2018, the COT project developers
2013-2019, the COT project developers
.\" Generated by docutils manpage writer.
.
4 changes: 2 additions & 2 deletions COT/docs/man/cot-inject-config.1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "COT-INJECT-CONFIG" "1" "Jan 29, 2018" "2.1.0" "Common OVF Tool (COT)"
.TH "COT-INJECT-CONFIG" "1" "Feb 18, 2019" "2.2.0" "Common OVF Tool (COT)"
.SH NAME
cot-inject-config \- Add bootstrap configuration to an OVF or OVA
.
Expand Down Expand Up @@ -84,6 +84,6 @@ Additional file(s) to include as\-is
.SH AUTHOR
Glenn F. Matthews
.SH COPYRIGHT
2013-2018, the COT project developers
2013-2019, the COT project developers
.\" Generated by docutils manpage writer.
.
4 changes: 2 additions & 2 deletions COT/docs/man/cot-install-helpers.1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "COT-INSTALL-HELPERS" "1" "Jan 29, 2018" "2.1.0" "Common OVF Tool (COT)"
.TH "COT-INSTALL-HELPERS" "1" "Feb 18, 2019" "2.2.0" "Common OVF Tool (COT)"
.SH NAME
cot-install-helpers \- Install helper programs used by COT
.
Expand Down Expand Up @@ -138,6 +138,6 @@ for you at present.
.SH AUTHOR
Glenn F. Matthews
.SH COPYRIGHT
2013-2018, the COT project developers
2013-2019, the COT project developers
.\" Generated by docutils manpage writer.
.
4 changes: 2 additions & 2 deletions COT/docs/man/cot-remove-file.1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "COT-REMOVE-FILE" "1" "Jan 29, 2018" "2.1.0" "Common OVF Tool (COT)"
.TH "COT-REMOVE-FILE" "1" "Feb 18, 2019" "2.2.0" "Common OVF Tool (COT)"
.SH NAME
cot-remove-file \- Remove file from an OVF or OVA
.
Expand Down Expand Up @@ -78,6 +78,6 @@ File ID string within the package
.SH AUTHOR
Glenn F. Matthews
.SH COPYRIGHT
2013-2018, the COT project developers
2013-2019, the COT project developers
.\" Generated by docutils manpage writer.
.
6 changes: 3 additions & 3 deletions COT/docs/man/cot.1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "COT" "1" "Jan 29, 2018" "2.1.0" "Common OVF Tool (COT)"
.TH "COT" "1" "Feb 18, 2019" "2.2.0" "Common OVF Tool (COT)"
.SH NAME
cot \- Common OVF Tool
.
Expand Down Expand Up @@ -47,7 +47,7 @@ cot <options> <command> <command\-options>
.UNINDENT
.SH DESCRIPTION
.sp
Common OVF Tool (COT), version 2.1.0
Common OVF Tool (COT), version 2.2.0
.sp
A tool for editing Open Virtualization Format (.ovf, .ova) virtual
appliances, with a focus on virtualized network appliances such as the
Expand Down Expand Up @@ -128,6 +128,6 @@ Remove a file from an OVF package
.SH AUTHOR
Glenn F. Matthews
.SH COPYRIGHT
2013-2018, the COT project developers
2013-2019, the COT project developers
.\" Generated by docutils manpage writer.
.
4 changes: 3 additions & 1 deletion COT/platforms/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# October 2013, Glenn F. Matthews
# Copyright (c) 2013-2017 the COT project developers.
# Copyright (c) 2013-2017, 2019 the COT project developers.
# See the COPYRIGHT.txt file at the top-level directory of this distribution
# and at https://github.com/glennmatthews/cot/blob/master/COPYRIGHT.txt.
#
Expand Down Expand Up @@ -41,6 +41,7 @@
COT.platforms.cisco_iosxrv_9000
COT.platforms.cisco_nexus_9000v
COT.platforms.cisco_nxosv
COT.platforms.cisco_c9800cl
"""

import logging
Expand All @@ -54,6 +55,7 @@
from .cisco_iosxrv_9000 import IOSXRv9000
from .cisco_nexus_9000v import Nexus9000v
from .cisco_nxosv import NXOSv
from .cisco_c9800cl import C9800CL

logger = logging.getLogger(__name__)

Expand Down
85 changes: 85 additions & 0 deletions COT/platforms/cisco_c9800cl.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# February 2019, Subba Srinivas
# Copyright (c) 2019 the COT project developers.
# See the COPYRIGHT.txt file at the top-level directory of this distribution
# and at https://github.com/glennmatthews/cot/blob/master/COPYRIGHT.txt.
#
# This file is part of the Common OVF Tool (COT) project.
# It is subject to the license terms in the LICENSE.txt file found in the
# top-level directory of this distribution and at
# https://github.com/glennmatthews/cot/blob/master/LICENSE.txt. No part
# of COT, including this file, may be copied, modified, propagated, or
# distributed except according to the terms contained in the LICENSE.txt file.

"""Platform logic for the Cisco C9800-CL Wireless Lan Controller."""

import logging

from COT.platforms.platform import Platform, Hardware
from COT.data_validation import ValueUnsupportedError, ValidRange

logger = logging.getLogger(__name__)


class C9800CL(Platform):
"""Platform-specific logic for Cisco C9800-CL platform."""

PLATFORM_NAME = "Cisco C9800-CL"

CONFIG_TEXT_FILE = 'iosxe_config.txt'
LITERAL_CLI_STRING = 'ios-config'
# C9800CL doesn't 'officially' support E1000, but it mostly works
SUPPORTED_NIC_TYPES = ["E1000", "virtio", "VMXNET3"]

HARDWARE_LIMITS = Platform.HARDWARE_LIMITS.copy()
HARDWARE_LIMITS.update({
Hardware.cpus: ValidRange(4, 10),
Hardware.memory: ValidRange(8192, 32768),
Hardware.nic_count: ValidRange(1, 3),
Hardware.serial_count: ValidRange(0, 2),
})

def controller_type_for_device(self, device_type):
"""C9800CL uses SCSI for hard disks and IDE for CD-ROMs.
Args:
device_type (str): 'harddisk' or 'cdrom'
Returns:
str: 'ide' for CD-ROM, 'scsi' for hard disk
"""
if device_type == 'harddisk':
return 'scsi'
elif device_type == 'cdrom':
return 'ide'
else:
return super(C9800CL, self).controller_type_for_device(
device_type)

def guess_nic_name(self, nic_number):
"""GigabitEthernet1, GigabitEthernet2, etc.
Args:
nic_number (int): Nth NIC to name.
Returns:
* "GigabitEthernet1"
* "GigabitEthernet2"
* etc.
"""
return "GigabitEthernet" + str(nic_number)

def validate_cpu_count(self, cpus):
"""C9800CL supports 4,6 or 10 CPUs.
Args:
cpus (int): Number of CPUs.
Raises:
ValueTooLowError: if ``cpus`` is less than 4
ValueTooHighError: if ``cpus`` is more than 10
ValueUnsupportedError: if ``cpus`` is a value other than 4, 6, 10
"""
super(C9800CL, self).validate_cpu_count(cpus)
if cpus not in [4, 6, 10]:
raise ValueUnsupportedError("CPUs", cpus, [4, 6, 10])


Platform.PRODUCT_PLATFORM_MAP['com.cisco.vwlc'] = C9800CL
Loading

0 comments on commit cf08987

Please sign in to comment.