← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1592150] [NEW] Having multiple values in a yumrepos key results in incorrectly formatted yum repo config

 

Public bug reported:

According to the code to handle yumrepos, cloud-init "Can handle 'lists'
in certain cases".

When I specify a list in my cloud-config, it is incorrectly formatted.
It is surrounded by '''triple single-quotes''' when rendered onto the
filesystem, causing the resulting configuration to be invalid.

I am using cloud-init from Centos7, from the amazon ami marketplace:

$ rpm -qi cloud-init
Name        : cloud-init
Version     : 0.7.5
Release     : 10.el7.centos.1
Architecture: x86_64
Install Date: Tue 29 Mar 2016 08:43:31 PM UTC
Group       : System Environment/Base
Size        : 1432841
License     : GPLv3
Signature   : RSA/SHA256, Wed 10 Sep 2014 12:33:32 PM UTC, Key ID 24c6a8a7f4a80eb5
Source RPM  : cloud-init-0.7.5-10.el7.centos.1.src.rpm
Build Date  : Wed 10 Sep 2014 11:05:45 AM UTC
Build Host  : worker1.bsys.centos.org
Relocations : (not relocatable)
Packager    : CentOS BuildSystem <http://bugs.centos.org>
Vendor      : CentOS
URL         : http://launchpad.net/cloud-init
Summary     : Cloud instance init scripts
Description :
Cloud-init is a set of init scripts for cloud instances.  Cloud instances
need special scripts to run during initialization to retrieve and install
ssh keys and to let the user run various scripts.

Example configuration:

yum_repos:
    saltstack:
        name: SaltStack repo for Red Hat Enterprise Linux $releasever
        baseurl: https://repo.saltstack.com/yum/redhat/$releasever/$basearch/latest
        enabled: true
        gpgcheck: true
        gpgkey:
            - https://repo.saltstack.com/yum/redhat/$releasever/$basearch/latest/SALTSTACK-GPG-KEY.pub
            - https://repo.saltstack.com/yum/redhat/$releasever/$basearch/latest/base/RPM-GPG-KEY-CentOS-7

Result of Example configuration:

# Created by cloud-init on Mon, 13 Jun 2016 20:05:01 +0000
[saltstack]
gpgcheck = 1
gpgkey = '''https://repo.saltstack.com/yum/redhat/$releasever/$basearch/latest/SALTSTACK-GPG-KEY.pub
    https://repo.saltstack.com/yum/redhat/$releasever/$basearch/latest/base/RPM-GPG-KEY-CentOS-7'''
enabled = 1
baseurl = https://repo.saltstack.com/yum/redhat/$releasever/$basearch/latest
name = SaltStack repo for Red Hat Enterprise Linux $releasever

** Affects: cloud-init
     Importance: Undecided
         Status: New


** Tags: 0.7.5 centos7 list rhel rpm yum yumrepos

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1592150

Title:
  Having multiple values in a yumrepos key results in incorrectly
  formatted yum repo config

Status in cloud-init:
  New

Bug description:
  According to the code to handle yumrepos, cloud-init "Can handle
  'lists' in certain cases".

  When I specify a list in my cloud-config, it is incorrectly formatted.
  It is surrounded by '''triple single-quotes''' when rendered onto the
  filesystem, causing the resulting configuration to be invalid.

  I am using cloud-init from Centos7, from the amazon ami marketplace:

  $ rpm -qi cloud-init
  Name        : cloud-init
  Version     : 0.7.5
  Release     : 10.el7.centos.1
  Architecture: x86_64
  Install Date: Tue 29 Mar 2016 08:43:31 PM UTC
  Group       : System Environment/Base
  Size        : 1432841
  License     : GPLv3
  Signature   : RSA/SHA256, Wed 10 Sep 2014 12:33:32 PM UTC, Key ID 24c6a8a7f4a80eb5
  Source RPM  : cloud-init-0.7.5-10.el7.centos.1.src.rpm
  Build Date  : Wed 10 Sep 2014 11:05:45 AM UTC
  Build Host  : worker1.bsys.centos.org
  Relocations : (not relocatable)
  Packager    : CentOS BuildSystem <http://bugs.centos.org>
  Vendor      : CentOS
  URL         : http://launchpad.net/cloud-init
  Summary     : Cloud instance init scripts
  Description :
  Cloud-init is a set of init scripts for cloud instances.  Cloud instances
  need special scripts to run during initialization to retrieve and install
  ssh keys and to let the user run various scripts.

  Example configuration:

  yum_repos:
      saltstack:
          name: SaltStack repo for Red Hat Enterprise Linux $releasever
          baseurl: https://repo.saltstack.com/yum/redhat/$releasever/$basearch/latest
          enabled: true
          gpgcheck: true
          gpgkey:
              - https://repo.saltstack.com/yum/redhat/$releasever/$basearch/latest/SALTSTACK-GPG-KEY.pub
              - https://repo.saltstack.com/yum/redhat/$releasever/$basearch/latest/base/RPM-GPG-KEY-CentOS-7

  Result of Example configuration:

  # Created by cloud-init on Mon, 13 Jun 2016 20:05:01 +0000
  [saltstack]
  gpgcheck = 1
  gpgkey = '''https://repo.saltstack.com/yum/redhat/$releasever/$basearch/latest/SALTSTACK-GPG-KEY.pub
      https://repo.saltstack.com/yum/redhat/$releasever/$basearch/latest/base/RPM-GPG-KEY-CentOS-7'''
  enabled = 1
  baseurl = https://repo.saltstack.com/yum/redhat/$releasever/$basearch/latest
  name = SaltStack repo for Red Hat Enterprise Linux $releasever

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1592150/+subscriptions


Follow ups