Remove support for fig.yaml, FIG_FILE, and FIG_PROJECT_NAME.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
Daniel Nephin 2016-01-04 15:35:57 -05:00
parent ea8cc1c3dc
commit 2acc29cf1c
6 changed files with 4 additions and 30 deletions

View File

@ -59,11 +59,7 @@ def get_config_path_from_options(options):
if file_option:
return file_option
if 'FIG_FILE' in os.environ:
log.warn('The FIG_FILE environment variable is deprecated.')
log.warn('Please use COMPOSE_FILE instead.')
config_file = os.environ.get('COMPOSE_FILE') or os.environ.get('FIG_FILE')
config_file = os.environ.get('COMPOSE_FILE')
return [config_file] if config_file else None
@ -96,14 +92,7 @@ def get_project_name(working_dir, project_name=None):
def normalize_name(name):
return re.sub(r'[^a-z0-9]', '', name.lower())
if 'FIG_PROJECT_NAME' in os.environ:
log.warn('The FIG_PROJECT_NAME environment variable is deprecated.')
log.warn('Please use COMPOSE_PROJECT_NAME instead.')
project_name = (
project_name or
os.environ.get('COMPOSE_PROJECT_NAME') or
os.environ.get('FIG_PROJECT_NAME'))
project_name = project_name or os.environ.get('COMPOSE_PROJECT_NAME')
if project_name is not None:
return normalize_name(project_name)

View File

@ -88,8 +88,6 @@ DOCKER_VALID_URL_PREFIXES = (
SUPPORTED_FILENAMES = [
'docker-compose.yml',
'docker-compose.yaml',
'fig.yml',
'fig.yaml',
]
DEFAULT_OVERRIDE_FILENAME = 'docker-compose.override.yml'
@ -162,10 +160,6 @@ def get_default_config_files(base_dir):
log.warn("Found multiple config files with supported names: %s", ", ".join(candidates))
log.warn("Using %s\n", winner)
if winner.startswith("fig."):
log.warn("%s is deprecated and will not be supported in future. "
"Please rename your config file to docker-compose.yml\n" % winner)
return [os.path.join(path, winner)] + get_default_override_file(path)

View File

@ -28,7 +28,7 @@ __docker_compose_nospace() {
# Support for these filenames might be dropped in some future version.
__docker_compose_compose_file() {
local file
for file in docker-compose.y{,a}ml fig.y{,a}ml ; do
for file in docker-compose.y{,a}ml ; do
[ -e $file ] && {
echo $file
return

View File

@ -24,7 +24,7 @@
# Support for these filenames might be dropped in some future version.
__docker-compose_compose_file() {
local file
for file in docker-compose.y{,a}ml fig.y{,a}ml ; do
for file in docker-compose.y{,a}ml ; do
[ -e $file ] && {
echo $file
return

View File

@ -42,13 +42,6 @@ class CLITestCase(unittest.TestCase):
project_name = get_project_name(None, project_name=name)
self.assertEquals('explicitprojectname', project_name)
def test_project_name_from_environment_old_var(self):
name = 'namefromenv'
with mock.patch.dict(os.environ):
os.environ['FIG_PROJECT_NAME'] = name
project_name = get_project_name(None)
self.assertEquals(project_name, name)
def test_project_name_from_environment_new_var(self):
name = 'namefromenv'
with mock.patch.dict(os.environ):

View File

@ -1616,8 +1616,6 @@ class GetDefaultConfigFilesTestCase(unittest.TestCase):
files = [
'docker-compose.yml',
'docker-compose.yaml',
'fig.yml',
'fig.yaml',
]
def test_get_config_path_default_file_in_basedir(self):