# Path: pyeapi/utils.py
# def make_iterable(value):
#     """Converts the supplied value to a list object
# 
#     This function will inspect the supplied value and return an
#     iterable in the form of a list.
# 
#     Args:
#         value (object): An valid Python object
# 
#     Returns:
#         An iterable object of type list
#     """
#     if sys.version_info <= (3, 0):
#         # Convert unicode values to strings for Python 2
#         if isinstance(value, unicode):
#             value = str(value)
#     if isinstance(value, str) or isinstance(value, dict):
#         value = [value]
# 
#     if sys.version_info <= (3, 3):
#         if not isinstance(value, collections.Iterable):
#             raise TypeError('value must be an iterable object')
#     else:
#         if not isinstance(value, collections.abc.Iterable):
#             raise TypeError('value must be an iterable object')
# 
#     return value


import re
from pyeapi.api import Entity
from pyeapi.utils import make_iterable
    def create(self, ospf_process_id, vrf=None):
        """Creates a OSPF process in the specified VRF or the default VRF.

           Args:
                ospf_process_id (str): The OSPF process Id value
                vrf (str): The VRF to apply this OSPF process to
           Returns:
                bool: True if the command completed successfully
           Exception:
                ValueError: If the ospf_process_id passed in less
                            than 0 or greater than 65536
        """
        value = int(ospf_process_id)
        if not 0 < value < 65536:
            raise ValueError('ospf as must be between 1 and 65535')
        command = 'router ospf {}'.format(ospf_process_id)
        if vrf:
            command += ' vrf %s' % vrf
        return self.configure(command)

    def configure_ospf(self, cmd):
        """Allows for a list of OSPF subcommands to be configured"

           Args:
               cmd: (list or str): Subcommand to be entered
           Returns:
               bool: True if all the commands completed successfully
        """
        config = self.get()
        cmds = ['router ospf {}'.format(config['ospf_process_id'])]

# Path: pyeapi/utils.py
# def make_iterable(value):
#     """Converts the supplied value to a list object
# 
#     This function will inspect the supplied value and return an
#     iterable in the form of a list.
# 
#     Args:
#         value (object): An valid Python object
# 
#     Returns:
#         An iterable object of type list
#     """
#     if sys.version_info <= (3, 0):
#         # Convert unicode values to strings for Python 2
#         if isinstance(value, unicode):
#             value = str(value)
#     if isinstance(value, str) or isinstance(value, dict):
#         value = [value]
# 
#     if sys.version_info <= (3, 3):
#         if not isinstance(value, collections.Iterable):
#             raise TypeError('value must be an iterable object')
#     else:
#         if not isinstance(value, collections.abc.Iterable):
#             raise TypeError('value must be an iterable object')
# 
#     return value


# Path: pyeapi/api/ospf.py
import re
from pyeapi.api import Entity
from pyeapi.utils import make_iterable

    def create(self, ospf_process_id, vrf=None):
        """Creates a OSPF process in the specified VRF or the default VRF.

           Args:
                ospf_process_id (str): The OSPF process Id value
                vrf (str): The VRF to apply this OSPF process to
           Returns:
                bool: True if the command completed successfully
           Exception:
                ValueError: If the ospf_process_id passed in less
                            than 0 or greater than 65536
        """
        value = int(ospf_process_id)
        if not 0 < value < 65536:
            raise ValueError('ospf as must be between 1 and 65535')
        command = 'router ospf {}'.format(ospf_process_id)
        if vrf:
            command += ' vrf %s' % vrf
        return self.configure(command)

    def configure_ospf(self, cmd):
        """Allows for a list of OSPF subcommands to be configured"

           Args:
               cmd: (list or str): Subcommand to be entered
           Returns:
               bool: True if all the commands completed successfully
        """
        config = self.get()
        cmds = ['router ospf {}'.format(config['ospf_process_id'])]

        cmds.extend(make_iterable(cmd))