def test_get_resource(self):
     resource = utils.get_resource(os.path.join(
         'pm',
         'initd',
         'initd.conf.template'
     ))
     self.assertIsNotNone(resource)
示例#2
0
 def build(self):
     if self.cloudify_agent['windows']:
         resource = 'script/windows.ps1.template'
     else:
         resource = 'script/linux.sh.template'
     template = jinja2.Template(utils.get_resource(resource))
     # called before so that custom_env and custom_env_path
     # get populated
     daemon_env = self._create_agent_env()
     return template.render(
         conf=self.cloudify_agent,
         daemon_env=daemon_env,
         pm_options=self._create_process_management_options(),
         custom_env=self.custom_env,
         custom_env_path=self.custom_env_path,
         file_server_url=cloudify_utils.get_manager_file_server_url(),
         configure_flags=self._configure_flags())
示例#3
0
 def build(self):
     if self.cloudify_agent['windows']:
         resource = 'script/windows.ps1.template'
     else:
         resource = 'script/linux.sh.template'
     template = jinja2.Template(utils.get_resource(resource))
     # called before so that custom_env and custom_env_path
     # get populated
     daemon_env = self._create_agent_env()
     return template.render(
         conf=self.cloudify_agent,
         daemon_env=daemon_env,
         pm_options=self._create_process_management_options(),
         custom_env=self.custom_env,
         custom_env_path=self.custom_env_path,
         file_server_url=cloudify_utils.get_manager_file_server_url(),
         configure_flags=self._configure_flags())
示例#4
0
 def build(self):
     if self.cloudify_agent['windows']:
         resource = 'script/windows.ps1.template'
     else:
         resource = 'script/linux.sh.template'
     template = jinja2.Template(utils.get_resource(resource))
     # Called before creating the agent env to populate all the variables
     local_rest_content = self._get_local_cert_content()
     remote_ssl_cert_path = self._get_remote_ssl_cert_path()
     # Called before rendering the template to populate all the variables
     daemon_env = self._create_agent_env()
     return template.render(
         conf=self.cloudify_agent,
         daemon_env=daemon_env,
         pm_options=self._create_process_management_options(),
         custom_env=self.custom_env,
         custom_env_path=self.custom_env_path,
         file_server_url=cloudify_utils.get_manager_file_server_url(),
         configure_flags=self._configure_flags(),
         ssl_cert_content=local_rest_content,
         ssl_cert_path=remote_ssl_cert_path,
         auth_token_header=CLOUDIFY_TOKEN_AUTHENTICATION_HEADER,
         auth_token_value=ctx.rest_token)
示例#5
0
def test_get_resource():
    resource = utils.get_resource(
        os.path.join('pm', 'initd', 'initd.conf.template'))
    assert resource is not None
示例#6
0
 def test_get_resource(self):
     resource = utils.get_resource(
         os.path.join('pm', 'initd', 'initd.conf.template'))
     self.assertIsNotNone(resource)
示例#7
0
 def _get_template(template_filename):
     return jinja2.Template(
         utils.get_resource(template_filename),
         trim_blocks=True,
         lstrip_blocks=True,
     )