MCPcopy Create free account
hub / github.com/ceph/ceph / _config_user

Method _config_user

qa/tasks/s3tests_java.py:218–253  ·  view source on GitHub ↗

Generate missing users data for this section by stashing away keys, ids, and email addresses.

(self, s3tests_conf, section, user, client)

Source from the content-addressed store, hash-verified

216 "rm -rf /home/{local}/s3tests.teuth.config.yaml".format(local=local_user))
217
218 def _config_user(self, s3tests_conf, section, user, client):
219 """
220 Generate missing users data for this section by stashing away keys, ids, and
221 email addresses.
222 """
223 access_key = ''.join(random.choice(string.ascii_uppercase)
224 for i in range(20))
225 access_secret = base64.b64encode(os.urandom(40)).decode('ascii')
226 endpoint = self.ctx.rgw.role_endpoints.get(client)
227
228 self._set_cfg_entry(
229 s3tests_conf[section], 'user_id', '{user}'.format(user=user))
230 self._set_cfg_entry(
231 s3tests_conf[section], 'email', '{user}_test@test.test'.format(user=user))
232 self._set_cfg_entry(
233 s3tests_conf[section], 'display_name', 'Ms. {user}'.format(user=user))
234 self._set_cfg_entry(
235 s3tests_conf[section], 'access_key', '{ak}'.format(ak=access_key))
236 self._set_cfg_entry(
237 s3tests_conf[section], 'access_secret', '{asc}'.format(asc=access_secret))
238 self._set_cfg_entry(
239 s3tests_conf[section], 'region', 'us-east-1')
240 self._set_cfg_entry(
241 s3tests_conf[section], 'endpoint', '{ip}:{port}'.format(
242 ip=endpoint.hostname, port=endpoint.port))
243 self._set_cfg_entry(
244 s3tests_conf[section], 'host', endpoint.hostname)
245 self._set_cfg_entry(
246 s3tests_conf[section], 'port', endpoint.port)
247 self._set_cfg_entry(
248 s3tests_conf[section], 'is_secure', True if endpoint.cert else False)
249
250 log.debug("S3 Tests Java: s3tests_conf[{sect}] is {s3cfg}".format(
251 sect=section, s3cfg=s3tests_conf[section]))
252 log.debug('S3 Tests Java: Setion, User = {sect}, {user}'.format(
253 sect=section, user=user))
254
255 def _write_cfg_file(self, cfg_dict, client):
256 """

Callers 2

create_usersMethod · 0.95
_config_userFunction · 0.80

Calls 6

_set_cfg_entryMethod · 0.95
joinMethod · 0.45
decodeMethod · 0.45
getMethod · 0.45
formatMethod · 0.45
debugMethod · 0.45

Tested by

no test coverage detected