def _generate_injection_cmd(self, meta_data):
        """ example injector response:
        [
           {
              "config_path":"/configs/cli_config.py",
              "path":"/opt/cia-cli/cia_sdk/config",
              "user":"injector",
              "status_code":201,
              "chmod":755,
              "checksum":"a4bcf3939dd3a6aa4e04ee9f92131df4",
              "created":"2015-08-04T22:48:25Z",
              "updated":"2015-08-04T22:48:25Z",
              "group":"injector"
           }
        ]

        """
        cmd = []
        self._validate_templates(meta_data)
        for i, config_data in enumerate(meta_data):
            container_path = os.path.join(config_data['path'], config_data['name'])

            cmd.append("mkdir")
            cmd.append("-p")
            cmd.append(config_data['path'])
            cmd.append("&&")
            cmd.append("cp")
            cmd.append("-f")
            cmd.append(config_data['config_path'])
            cmd.append(container_path)
            cmd.append("&&")
            cmd.append("chown")
            cmd.append("{0}:{1}".format(config_data['user'], config_data['group']))
            cmd.append(container_path)
            cmd.append("&&")
            cmd.append("chmod")
            cmd.append(six.text_type(config_data['chmod']))
            cmd.append(container_path)

            if i + 1 < len(meta_data):
                cmd.append("&&")

        cmd = ["-c", " ".join(cmd)]
        return cmd
def _generate_injection_cmd ( self , meta_data ) : cmd = [ ] self . _validate_templates ( meta_data ) for i , config_data in enumerate ( meta_data ) : container_path = os . path . join ( config_data [ 'path' ] , config_data [ 'name' ] ) cmd . append ( "mkdir" ) cmd . append ( "-p" ) cmd . append ( config_data [ 'path' ] ) cmd . append ( "&&" ) cmd . append ( "cp" ) cmd . append ( "-f" ) cmd . append ( config_data [ 'config_path' ] ) cmd . append ( container_path ) cmd . append ( "&&" ) cmd . append ( "chown" ) cmd . append ( "{0}:{1}" . format ( config_data [ 'user' ] , config_data [ 'group' ] ) ) cmd . append ( container_path ) cmd . append ( "&&" ) cmd . append ( "chmod" ) cmd . append ( six . text_type ( config_data [ 'chmod' ] ) ) cmd . append ( container_path ) if i + 1 < len ( meta_data ) : cmd . append ( "&&" ) cmd = [ "-c" , " " . join ( cmd ) ] return cmd
example injector response:
        [
           {
              "config_path":"/configs/cli_config.py",
              "path":"/opt/cia-cli/cia_sdk/config",
              "user":"injector",
              "status_code":201,
              "chmod":755,
              "checksum":"a4bcf3939dd3a6aa4e04ee9f92131df4",
              "created":"2015-08-04T22:48:25Z",
              "updated":"2015-08-04T22:48:25Z",
              "group":"injector"
           }
        ]