Ejemplo n.º 1
0
 def test_parse_return_space(self):
     '''
     test parse_return function
     space after colon
     '''
     self.assertEqual(mac_utils.parse_return('spongebob: squarepants'),
                      'squarepants')
Ejemplo n.º 2
0
 def test_parse_return_space(self):
     """
     test parse_return function
     space after colon
     """
     self.assertEqual(mac_utils.parse_return("spongebob: squarepants"),
                      "squarepants")
Ejemplo n.º 3
0
 def test_parse_return_space(self):
     '''
     test parse_return function
     space after colon
     '''
     self.assertEqual(mac_utils.parse_return('spongebob: squarepants'),
                      'squarepants')
Ejemplo n.º 4
0
 def test_parse_return_new_line(self):
     '''
     test parse_return function
     new line after colon
     '''
     self.assertEqual(mac_utils.parse_return('spongebob:\nsquarepants'),
                      'squarepants')
Ejemplo n.º 5
0
 def test_parse_return_new_line(self):
     """
     test parse_return function
     new line after colon
     """
     self.assertEqual(mac_utils.parse_return("spongebob:\nsquarepants"),
                      "squarepants")
Ejemplo n.º 6
0
 def test_parse_return_new_line(self):
     '''
     test parse_return function
     new line after colon
     '''
     self.assertEqual(mac_utils.parse_return('spongebob:\nsquarepants'),
                      'squarepants')
Ejemplo n.º 7
0
 def test_parse_return_no_delimiter(self):
     '''
     test parse_return function
     no delimiter
     '''
     self.assertEqual(mac_utils.parse_return('squarepants'),
                      'squarepants')
Ejemplo n.º 8
0
 def test_parse_return_no_delimiter(self):
     '''
     test parse_return function
     no delimiter
     '''
     self.assertEqual(mac_utils.parse_return('squarepants'),
                      'squarepants')
Ejemplo n.º 9
0
def get_startup_disk():
    '''
    Displays the current startup disk

    :return: The current startup disk
    :rtype: str

    CLI Example:

    .. code-block:: bash

        salt '*' system.get_startup_disk
    '''
    ret = execute_return_result('systemsetup -getstartupdisk')
    return parse_return(ret)
Ejemplo n.º 10
0
def get_subnet_name():
    '''
    Gets the local subnet name

    :return: The local subnet name
    :rtype: str

    CLI Example:

    .. code-block:: bash

        salt '*' system.get_subnet_name
    '''
    ret = execute_return_result('systemsetup -getlocalsubnetname')
    return parse_return(ret)
Ejemplo n.º 11
0
def get_remote_login():
    '''
    Displays whether remote login (SSH) is on or off.

    :return: A string value representing the "remote login" status
    :rtype: str

    CLI Example:

    .. code-block:: bash

        salt '*' system.get_remote_login
    '''
    ret = execute_return_result('systemsetup -getremotelogin')
    return parse_return(ret)
Ejemplo n.º 12
0
def get_restart_freeze():
    '''
    Displays whether 'restart on freeze' is on or off if supported

    :return: A string value representing the "restart on freeze" settings
    :rtype: string

    CLI Example:

    .. code-block:: bash

        salt '*' power.get_restart_freeze
    '''
    ret = execute_return_result('systemsetup -getrestartfreeze')
    return parse_return(ret)
Ejemplo n.º 13
0
def get_wake_on_network():
    '''
    Displays whether 'wake on network' is on or off if supported

    :return: A string value representing the "wake on network" settings
    :rtype: string

    CLI Example:

    .. code-block:: bash

        salt '*' power.get_wake_on_network
    '''
    ret = execute_return_result('systemsetup -getwakeonnetworkaccess')
    return parse_return(ret)
Ejemplo n.º 14
0
def get_harddisk_sleep():
    '''
    Display the amount of idle time until the hard disk sleeps.

    :return: A string representing the sleep settings for the hard disk
    :rtype: str

    CLI Example:

    ..code-block:: bash

        salt '*' power.get_harddisk_sleep
    '''
    ret = execute_return_result('systemsetup -getharddisksleep')
    return parse_return(ret)
Ejemplo n.º 15
0
def get_remote_events():
    '''
    Displays whether remote apple events are on or off.

    :return: A string value representing the "remote apple events" setting
    :rtype: str

    CLI Example:

    .. code-block:: bash

        salt '*' system.get_remote_events
    '''
    ret = execute_return_result('systemsetup -getremoteappleevents')
    return parse_return(ret)
Ejemplo n.º 16
0
def get_boot_arch():
    '''
    Get the kernel architecture setting from ``com.apple.Boot.plist``

    :return: A string value representing the boot architecture setting
    :rtype: str

    CLI Example:

    .. code-block:: bash

        salt '*' system.get_boot_arch
    '''
    ret = execute_return_result(
        'systemsetup -getkernelbootarchitecturesetting')
    return parse_return(ret)
Ejemplo n.º 17
0
def get_disable_keyboard_on_lock():
    '''
    Get whether or not the keyboard should be disabled when the X Serve enclosure
    lock is engaged.

    :return: A string value representing the "Disable Keyboard on Lock" status
    :rtype: str

    CLI Example:

    ..code-block:: bash

        salt '*' system.get_disable_keyboard_on_lock
    '''
    ret = execute_return_result(
        'systemsetup -getdisablekeyboardwhenenclosurelockisengaged')
    return parse_return(ret)
Ejemplo n.º 18
0
def get_sleep_on_power_button():
    '''
    Displays whether 'allow power button to sleep computer' is on or off if
    supported

    :return: A string value representing the "allow power button to sleep
    computer" settings
    :rtype: string

    CLI Example:

    .. code-block:: bash

        salt '*' power.get_sleep_on_power_button
    '''
    ret = execute_return_result(
        'systemsetup -getallowpowerbuttontosleepcomputer')
    return parse_return(ret)
Ejemplo n.º 19
0
def get_restart_delay():
    '''
    Get the number of seconds after which the computer will start up after a
    power failure.

    :return: A string value representing the number of seconds the system will
    delay restart after power loss
    :rtype: str

    CLI Example:

    .. code-block:: bash

        salt '*' system.get_restart_delay
    '''
    ret = execute_return_result(
        'systemsetup -getwaitforstartupafterpowerfailure')
    return parse_return(ret)
Ejemplo n.º 20
0
 def test_parse_return_no_delimiter(self):
     """
     test parse_return function
     no delimiter
     """
     self.assertEqual(mac_utils.parse_return("squarepants"), "squarepants")