mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Merge pull request #28596 from rallytime/merge-2015.8
Merge branch '2015.5' into '2015.8'
This commit is contained in:
commit
572d95b3e1
@ -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.
|
||||
|
||||
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:
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
.. _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
|
||||
isolated into separate branches.
|
||||
|
||||
If you're working on a fix, create your branch from the oldest release
|
||||
branch having the bug. See :ref:`Which Salt Branch? <which-salt-branch>`.
|
||||
If you're working on a bug or documentation fix, create your branch from
|
||||
the oldest release branch that contains the bug or requires the documentation
|
||||
update. See :ref:`Which Salt Branch? <which-salt-branch>`.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
@ -163,14 +166,15 @@ Which Salt branch?
|
||||
==================
|
||||
|
||||
GitHub will open pull requests against Salt's main branch, ``develop``, by
|
||||
default. Ideally features should go into ``develop`` and bug fixes should go
|
||||
into the oldest supported release branch affected by the bug. See
|
||||
default. Ideally, features should go into ``develop`` and bug fixes and
|
||||
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>`.
|
||||
|
||||
If you have a bug fix and have already forked your working branch from
|
||||
``develop`` and do not know how to rebase your commits against another branch,
|
||||
then submit it to ``develop`` anyway and we'll be sure to backport it to the
|
||||
correct place.
|
||||
If you have a bug fix or doc change and have already forked your working
|
||||
branch from ``develop`` and do not know how to rebase your commits against
|
||||
another branch, then submit it to ``develop`` anyway and we'll be sure to
|
||||
back-port it to the correct place.
|
||||
|
||||
The current release branch
|
||||
--------------------------
|
||||
|
@ -298,6 +298,26 @@ cross-referenced using two custom roles, ``conf_master``, and ``conf_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:
|
||||
|
||||
Building the documentation
|
||||
|
@ -36,9 +36,9 @@ Connection module for Amazon Route53
|
||||
.. code-block:: yaml
|
||||
|
||||
myprofile:
|
||||
keyid: GKTADJGHEIQSXMKKRBJ08H
|
||||
key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
|
||||
region: us-east-1
|
||||
keyid: GKTADJGHEIQSXMKKRBJ08H
|
||||
key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
|
||||
region: us-east-1
|
||||
|
||||
:depends: boto
|
||||
'''
|
||||
|
@ -1,6 +1,8 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
'''
|
||||
Create virtualenv environments
|
||||
Create virtualenv environments.
|
||||
|
||||
.. versionadded:: 0.17.0
|
||||
'''
|
||||
from __future__ import absolute_import
|
||||
|
||||
@ -88,9 +90,17 @@ def create(path,
|
||||
Set ownership for the virtualenv
|
||||
runas : None
|
||||
Set ownership for the virtualenv
|
||||
use_vt
|
||||
|
||||
use_vt : False
|
||||
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::
|
||||
The ``runas`` argument is deprecated as of 2014.1.0. ``user`` should be
|
||||
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
|
||||
|
||||
.. versionadded:: 2015.5.0
|
||||
|
||||
venv
|
||||
Path to the virtualenv.
|
||||
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
|
||||
|
||||
.. versionadded:: 2015.5.0
|
||||
|
||||
venv
|
||||
Path to the virtualenv.
|
||||
package_or_requirement
|
||||
|
@ -17,6 +17,7 @@ from datetime import datetime
|
||||
try:
|
||||
import win32net
|
||||
import win32api
|
||||
import win32con
|
||||
import pywintypes
|
||||
from ctypes import windll
|
||||
HAS_WIN32NET_MODS = True
|
||||
@ -289,7 +290,8 @@ def set_computer_name(name):
|
||||
if name:
|
||||
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']}}
|
||||
pending = get_pending_computer_name()
|
||||
if pending not in (None, False):
|
||||
|
@ -29,46 +29,46 @@ passed in as a dict, or as a string to pull from pillars or minion config:
|
||||
.. code-block:: yaml
|
||||
|
||||
myprofile:
|
||||
keyid: GKTADJGHEIQSXMKKRBJ08H
|
||||
key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
|
||||
region: us-east-1
|
||||
keyid: GKTADJGHEIQSXMKKRBJ08H
|
||||
key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
|
||||
region: us-east-1
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
mycnamerecord:
|
||||
boto_route53.present:
|
||||
- name: test.example.com.
|
||||
- value: my-elb.us-east-1.elb.amazonaws.com.
|
||||
- zone: example.com.
|
||||
- ttl: 60
|
||||
- record_type: CNAME
|
||||
- region: us-east-1
|
||||
- keyid: GKTADJGHEIQSXMKKRBJ08H
|
||||
- key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
|
||||
boto_route53.present:
|
||||
- name: test.example.com.
|
||||
- value: my-elb.us-east-1.elb.amazonaws.com.
|
||||
- zone: example.com.
|
||||
- ttl: 60
|
||||
- record_type: CNAME
|
||||
- region: us-east-1
|
||||
- keyid: GKTADJGHEIQSXMKKRBJ08H
|
||||
- key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
|
||||
|
||||
# Using a profile from pillars
|
||||
myarecord:
|
||||
boto_route53.present:
|
||||
- name: test.example.com.
|
||||
- value: 1.1.1.1
|
||||
- zone: example.com.
|
||||
- ttl: 60
|
||||
- record_type: A
|
||||
- region: us-east-1
|
||||
- profile: myprofile
|
||||
boto_route53.present:
|
||||
- name: test.example.com.
|
||||
- value: 1.1.1.1
|
||||
- zone: example.com.
|
||||
- ttl: 60
|
||||
- record_type: A
|
||||
- region: us-east-1
|
||||
- profile: myprofile
|
||||
|
||||
# Passing in a profile
|
||||
myarecord:
|
||||
boto_route53.present:
|
||||
- name: test.example.com.
|
||||
- value: 1.1.1.1
|
||||
- zone: example.com.
|
||||
- ttl: 60
|
||||
- record_type: A
|
||||
- region: us-east-1
|
||||
- profile:
|
||||
keyid: GKTADJGHEIQSXMKKRBJ08H
|
||||
key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
|
||||
boto_route53.present:
|
||||
- name: test.example.com.
|
||||
- value: 1.1.1.1
|
||||
- zone: example.com.
|
||||
- ttl: 60
|
||||
- record_type: A
|
||||
- region: us-east-1
|
||||
- profile:
|
||||
keyid: GKTADJGHEIQSXMKKRBJ08H
|
||||
key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
|
||||
'''
|
||||
|
||||
# Import Python Libs
|
||||
|
@ -1,8 +1,8 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
'''
|
||||
Setup of Python virtualenv sandboxes
|
||||
====================================
|
||||
Setup of Python virtualenv sandboxes.
|
||||
|
||||
.. versionadded:: 0.17.0
|
||||
'''
|
||||
from __future__ import absolute_import
|
||||
|
||||
|
@ -6,6 +6,7 @@ Set up the Salt integration test suite
|
||||
|
||||
# Import Python libs
|
||||
from __future__ import absolute_import, print_function
|
||||
import platform
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
@ -71,7 +72,11 @@ except ImportError:
|
||||
import yaml
|
||||
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'
|
||||
else:
|
||||
SYS_TMP_DIR = os.environ.get('TMPDIR', tempfile.gettempdir())
|
||||
@ -440,9 +445,14 @@ class TestDaemon(object):
|
||||
os.environ['SSH_DAEMON_RUNNING'] = 'True'
|
||||
roster_path = os.path.join(FILES, 'conf/_ssh/roster')
|
||||
shutil.copy(roster_path, TMP_CONF_DIR)
|
||||
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'))
|
||||
if salt.utils.is_windows():
|
||||
with salt.utils.fopen(os.path.join(TMP_CONF_DIR, 'roster'), 'a') as roster:
|
||||
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
|
||||
def config(cls, role):
|
||||
@ -484,7 +494,10 @@ class TestDaemon(object):
|
||||
shutil.rmtree(TMP_CONF_DIR)
|
||||
os.makedirs(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['user'] = running_tests_user
|
||||
tests_know_hosts_file = os.path.join(TMP_CONF_DIR, 'salt_ssh_known_hosts')
|
||||
|
@ -8,12 +8,15 @@ Discover all instances of unittest.TestCase in this directory.
|
||||
# Import python libs
|
||||
from __future__ import absolute_import, print_function
|
||||
import os
|
||||
import resource
|
||||
import tempfile
|
||||
import time
|
||||
|
||||
# Import salt libs
|
||||
from integration import TestDaemon, TMP # pylint: disable=W0403
|
||||
import salt.utils
|
||||
|
||||
if not salt.utils.is_windows():
|
||||
import resource
|
||||
|
||||
# Import Salt Testing libs
|
||||
from salttesting.parser import PNUM, print_header
|
||||
@ -255,7 +258,8 @@ class SaltTestsuiteParser(SaltCoverageTestingParser):
|
||||
return self.run_suite(path, display_name)
|
||||
|
||||
def start_daemons_only(self):
|
||||
self.prep_filehandles()
|
||||
if not salt.utils.is_windows():
|
||||
self.prep_filehandles()
|
||||
try:
|
||||
print_header(
|
||||
' * Setting up Salt daemons for interactive use',
|
||||
@ -360,7 +364,8 @@ class SaltTestsuiteParser(SaltCoverageTestingParser):
|
||||
# passing only `unit.<whatever>` to --name.
|
||||
# We don't need the tests daemon running
|
||||
return [True]
|
||||
self.prep_filehandles()
|
||||
if not salt.utils.is_windows():
|
||||
self.prep_filehandles()
|
||||
|
||||
try:
|
||||
print_header(
|
||||
|
Loading…
Reference in New Issue
Block a user