Merge pull request #28596 from rallytime/merge-2015.8

Merge branch '2015.5' into '2015.8'
This commit is contained in:
Nicole Thomas 2015-11-05 07:25:09 -07:00
commit 572d95b3e1
10 changed files with 115 additions and 55 deletions

View File

@ -38,7 +38,9 @@ override the ordering defined in the files, and the ``order`` option described
below will also override the order in which states are defined in sls files. below will also override the order in which states are defined in sls files.
If the classic ordering is preferred (lexicographic), then set If the classic ordering is preferred (lexicographic), then set
``state_auto_order`` to ``False`` in the master configuration file. ``state_auto_order`` to ``False`` in the master configuration file. Otherwise,
``state_auto_order`` defaults to ``True``.
.. _ordering_requisites: .. _ordering_requisites:

View File

@ -1,3 +1,5 @@
.. _contributing:
============ ============
Contributing Contributing
============ ============
@ -42,8 +44,9 @@ Fork a Repo Guide_>`_ and is well worth reading.
feature Y". Multiple unrelated fixes and/or features should be feature Y". Multiple unrelated fixes and/or features should be
isolated into separate branches. isolated into separate branches.
If you're working on a fix, create your branch from the oldest release If you're working on a bug or documentation fix, create your branch from
branch having the bug. See :ref:`Which Salt Branch? <which-salt-branch>`. the oldest release branch that contains the bug or requires the documentation
update. See :ref:`Which Salt Branch? <which-salt-branch>`.
.. code-block:: bash .. code-block:: bash
@ -163,14 +166,15 @@ Which Salt branch?
================== ==================
GitHub will open pull requests against Salt's main branch, ``develop``, by GitHub will open pull requests against Salt's main branch, ``develop``, by
default. Ideally features should go into ``develop`` and bug fixes should go default. Ideally, features should go into ``develop`` and bug fixes and
into the oldest supported release branch affected by the bug. See documentation changes should go into the oldest supported release branch
affected by the bug or documentation update. See
:ref:`Sending a GitHub pull request <github-pull-request>`. :ref:`Sending a GitHub pull request <github-pull-request>`.
If you have a bug fix and have already forked your working branch from If you have a bug fix or doc change and have already forked your working
``develop`` and do not know how to rebase your commits against another branch, branch from ``develop`` and do not know how to rebase your commits against
then submit it to ``develop`` anyway and we'll be sure to backport it to the another branch, then submit it to ``develop`` anyway and we'll be sure to
correct place. back-port it to the correct place.
The current release branch The current release branch
-------------------------- --------------------------

View File

@ -298,6 +298,26 @@ cross-referenced using two custom roles, ``conf_master``, and ``conf_minion``.
single minion. single minion.
.. _docs-ref-fixes:
Documentation Changes and Fixes
===============================
Documentation changes and fixes should be made against the earliest supported
release branch that the update applies to. The practice of updating a release
branch instead of making all documentation changes against Salt's main, default
branch, ``develop``, is necessary in order for the docs to be as up-to-date as
possible when the docs are built.
The workflow mentioned above is also inline with the recommendations outlined
in Salt's :ref:`contributing` page. You can read more about how to choose where
to submit documentation fixes by reading the :ref:`which-salt-branch` section.
For an explanation of how to submit changes against various branches, see the
:ref:`github-pull-request` section. Specifically, see the section describing
how to``Create a new branch`` and the steps that follow.
.. _docs-building: .. _docs-building:
Building the documentation Building the documentation

View File

@ -36,9 +36,9 @@ Connection module for Amazon Route53
.. code-block:: yaml .. code-block:: yaml
myprofile: myprofile:
keyid: GKTADJGHEIQSXMKKRBJ08H keyid: GKTADJGHEIQSXMKKRBJ08H
key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
region: us-east-1 region: us-east-1
:depends: boto :depends: boto
''' '''

View File

@ -1,6 +1,8 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
''' '''
Create virtualenv environments Create virtualenv environments.
.. versionadded:: 0.17.0
''' '''
from __future__ import absolute_import from __future__ import absolute_import
@ -88,9 +90,17 @@ def create(path,
Set ownership for the virtualenv Set ownership for the virtualenv
runas : None runas : None
Set ownership for the virtualenv Set ownership for the virtualenv
use_vt
use_vt : False
Use VT terminal emulation (see ouptut while installing) Use VT terminal emulation (see ouptut while installing)
.. versionadded:: 2015.5.0
saltenv : 'base'
Specify a different environment. The default environment is ``base``.
.. versionadded:: 2014.1.0
.. note:: .. note::
The ``runas`` argument is deprecated as of 2014.1.0. ``user`` should be The ``runas`` argument is deprecated as of 2014.1.0. ``user`` should be
used instead. used instead.
@ -306,6 +316,8 @@ def get_resource_path(venv, package_or_requirement, resource_name):
''' '''
Returns the path to a resource of a package or a distribution inside a virtualenv Returns the path to a resource of a package or a distribution inside a virtualenv
.. versionadded:: 2015.5.0
venv venv
Path to the virtualenv. Path to the virtualenv.
package_or_requirement package_or_requirement
@ -340,6 +352,8 @@ def get_resource_content(venv, package_or_requirement, resource_name):
''' '''
Returns the content of a resource of a package or a distribution inside a virtualenv Returns the content of a resource of a package or a distribution inside a virtualenv
.. versionadded:: 2015.5.0
venv venv
Path to the virtualenv. Path to the virtualenv.
package_or_requirement package_or_requirement

View File

@ -17,6 +17,7 @@ from datetime import datetime
try: try:
import win32net import win32net
import win32api import win32api
import win32con
import pywintypes import pywintypes
from ctypes import windll from ctypes import windll
HAS_WIN32NET_MODS = True HAS_WIN32NET_MODS = True
@ -289,7 +290,8 @@ def set_computer_name(name):
if name: if name:
name = name.decode('utf-8') name = name.decode('utf-8')
if windll.kernel32.SetComputerNameW(name): if windll.kernel32.SetComputerNameExW(win32con.ComputerNamePhysicalDnsHostname,
name):
ret = {'Computer Name': {'Current': get_system_info()['name']}} ret = {'Computer Name': {'Current': get_system_info()['name']}}
pending = get_pending_computer_name() pending = get_pending_computer_name()
if pending not in (None, False): if pending not in (None, False):

View File

@ -29,46 +29,46 @@ passed in as a dict, or as a string to pull from pillars or minion config:
.. code-block:: yaml .. code-block:: yaml
myprofile: myprofile:
keyid: GKTADJGHEIQSXMKKRBJ08H keyid: GKTADJGHEIQSXMKKRBJ08H
key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
region: us-east-1 region: us-east-1
.. code-block:: yaml .. code-block:: yaml
mycnamerecord: mycnamerecord:
boto_route53.present: boto_route53.present:
- name: test.example.com. - name: test.example.com.
- value: my-elb.us-east-1.elb.amazonaws.com. - value: my-elb.us-east-1.elb.amazonaws.com.
- zone: example.com. - zone: example.com.
- ttl: 60 - ttl: 60
- record_type: CNAME - record_type: CNAME
- region: us-east-1 - region: us-east-1
- keyid: GKTADJGHEIQSXMKKRBJ08H - keyid: GKTADJGHEIQSXMKKRBJ08H
- key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs - key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
# Using a profile from pillars # Using a profile from pillars
myarecord: myarecord:
boto_route53.present: boto_route53.present:
- name: test.example.com. - name: test.example.com.
- value: 1.1.1.1 - value: 1.1.1.1
- zone: example.com. - zone: example.com.
- ttl: 60 - ttl: 60
- record_type: A - record_type: A
- region: us-east-1 - region: us-east-1
- profile: myprofile - profile: myprofile
# Passing in a profile # Passing in a profile
myarecord: myarecord:
boto_route53.present: boto_route53.present:
- name: test.example.com. - name: test.example.com.
- value: 1.1.1.1 - value: 1.1.1.1
- zone: example.com. - zone: example.com.
- ttl: 60 - ttl: 60
- record_type: A - record_type: A
- region: us-east-1 - region: us-east-1
- profile: - profile:
keyid: GKTADJGHEIQSXMKKRBJ08H keyid: GKTADJGHEIQSXMKKRBJ08H
key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
''' '''
# Import Python Libs # Import Python Libs

View File

@ -1,8 +1,8 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
''' '''
Setup of Python virtualenv sandboxes Setup of Python virtualenv sandboxes.
====================================
.. versionadded:: 0.17.0
''' '''
from __future__ import absolute_import from __future__ import absolute_import

View File

@ -6,6 +6,7 @@ Set up the Salt integration test suite
# Import Python libs # Import Python libs
from __future__ import absolute_import, print_function from __future__ import absolute_import, print_function
import platform
import os import os
import re import re
import sys import sys
@ -71,7 +72,11 @@ except ImportError:
import yaml import yaml
import salt.ext.six as six import salt.ext.six as six
if os.uname()[0] == 'Darwin': if salt.utils.is_windows():
import win32api
if platform.uname()[0] == 'Darwin':
SYS_TMP_DIR = '/tmp' SYS_TMP_DIR = '/tmp'
else: else:
SYS_TMP_DIR = os.environ.get('TMPDIR', tempfile.gettempdir()) SYS_TMP_DIR = os.environ.get('TMPDIR', tempfile.gettempdir())
@ -440,9 +445,14 @@ class TestDaemon(object):
os.environ['SSH_DAEMON_RUNNING'] = 'True' os.environ['SSH_DAEMON_RUNNING'] = 'True'
roster_path = os.path.join(FILES, 'conf/_ssh/roster') roster_path = os.path.join(FILES, 'conf/_ssh/roster')
shutil.copy(roster_path, TMP_CONF_DIR) shutil.copy(roster_path, TMP_CONF_DIR)
with salt.utils.fopen(os.path.join(TMP_CONF_DIR, 'roster'), 'a') as roster: if salt.utils.is_windows():
roster.write(' user: {0}\n'.format(pwd.getpwuid(os.getuid()).pw_name)) with salt.utils.fopen(os.path.join(TMP_CONF_DIR, 'roster'), 'a') as roster:
roster.write(' priv: {0}/{1}'.format(TMP_CONF_DIR, 'key_test')) roster.write(' user: {0}\n'.format(win32api.GetUserName()))
roster.write(' priv: {0}/{1}'.format(TMP_CONF_DIR, 'key_test'))
else:
with salt.utils.fopen(os.path.join(TMP_CONF_DIR, 'roster'), 'a') as roster:
roster.write(' user: {0}\n'.format(pwd.getpwuid(os.getuid()).pw_name))
roster.write(' priv: {0}/{1}'.format(TMP_CONF_DIR, 'key_test'))
@classmethod @classmethod
def config(cls, role): def config(cls, role):
@ -484,7 +494,10 @@ class TestDaemon(object):
shutil.rmtree(TMP_CONF_DIR) shutil.rmtree(TMP_CONF_DIR)
os.makedirs(TMP_CONF_DIR) os.makedirs(TMP_CONF_DIR)
print(' * Transplanting configuration files to {0!r}'.format(TMP_CONF_DIR)) print(' * Transplanting configuration files to {0!r}'.format(TMP_CONF_DIR))
running_tests_user = pwd.getpwuid(os.getuid()).pw_name if salt.utils.is_windows():
running_tests_user = win32api.GetUserName()
else:
running_tests_user = pwd.getpwuid(os.getuid()).pw_name
master_opts = salt.config._read_conf_file(os.path.join(CONF_DIR, 'master')) master_opts = salt.config._read_conf_file(os.path.join(CONF_DIR, 'master'))
master_opts['user'] = running_tests_user master_opts['user'] = running_tests_user
tests_know_hosts_file = os.path.join(TMP_CONF_DIR, 'salt_ssh_known_hosts') tests_know_hosts_file = os.path.join(TMP_CONF_DIR, 'salt_ssh_known_hosts')

View File

@ -8,12 +8,15 @@ Discover all instances of unittest.TestCase in this directory.
# Import python libs # Import python libs
from __future__ import absolute_import, print_function from __future__ import absolute_import, print_function
import os import os
import resource
import tempfile import tempfile
import time import time
# Import salt libs # Import salt libs
from integration import TestDaemon, TMP # pylint: disable=W0403 from integration import TestDaemon, TMP # pylint: disable=W0403
import salt.utils
if not salt.utils.is_windows():
import resource
# Import Salt Testing libs # Import Salt Testing libs
from salttesting.parser import PNUM, print_header from salttesting.parser import PNUM, print_header
@ -255,7 +258,8 @@ class SaltTestsuiteParser(SaltCoverageTestingParser):
return self.run_suite(path, display_name) return self.run_suite(path, display_name)
def start_daemons_only(self): def start_daemons_only(self):
self.prep_filehandles() if not salt.utils.is_windows():
self.prep_filehandles()
try: try:
print_header( print_header(
' * Setting up Salt daemons for interactive use', ' * Setting up Salt daemons for interactive use',
@ -360,7 +364,8 @@ class SaltTestsuiteParser(SaltCoverageTestingParser):
# passing only `unit.<whatever>` to --name. # passing only `unit.<whatever>` to --name.
# We don't need the tests daemon running # We don't need the tests daemon running
return [True] return [True]
self.prep_filehandles() if not salt.utils.is_windows():
self.prep_filehandles()
try: try:
print_header( print_header(