{"push_id":651109484,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"0397f9c6a00c200572a55ba95d8a92a7a9596168","before":"77df95af1c740d18ee407e831a72bed613d1a0c7","commits":[{"sha":"0397f9c6a00c200572a55ba95d8a92a7a9596168","author":{"email":"d95b56ce41a2e1ac4cecdd398defd7414407cc08@review.openstack.org","name":"Jenkins"},"message":"Abstract 'mkdir' shell commands in guestagent\n\nThe guestagent commonly executes basic shell commands\nsuch as 'mkdir' across multiple files and datastores.\nEach datastore currently scripts its own shell calls.\nApart from cluttering the Python code with shell constructs,\nit also makes maintenance of the shell calls more difficult by\nrequiring the same change be made across multiple lines,\nsource files and/or potentially even datastores.\n\nThe goal of this patch set is to provide a simple straightforward\ninterface for most common shell calls used across the guestagent\ncode while encapsulating the related shell code into a single module.\n\nThis patch set includes refactoring of 'mkdir' and related 'chown'\ncalls.\nIt also introduces unit tests ('guestagent/test_operating_system')\nfor the above implementations.\n\nThe shell code was moved into 'common/operating_system' module.\nThe replacing interface is:\n\ndef create_directory(dir_path, user=None, group=None, force=True):\n    \"\"\"Create a given directory and update its ownership\n    (recursively) to the given user and group if any.\"\"\"\n\nThe existing interface for 'chown' has been extended to maintain\nconsistency with 'mkdir'.\n\ndef chown(path, user, group, recursive=True, force=False):\n    \"\"\"Changes the owner and group of a given file.\n    \"\"\"\n\nThe calls also take optional keyword arguments:\n    :param as_root:          Execute as root.\n    :type as_root:           boolean\n\n    :param timeout:          Number of seconds if specified,\n                             default if not.\n                             There is no timeout if set to None.\n    :type timeout:           integer\n\nMost occurrences of the above two shell calls ('mkdir' and 'chown')\nin the guestagent code have been replaced by the above abstraction.\nI did not replace native Python os.chown() and os.mkdir() calls\nand calls that are executed as a part of a larger shell script\nin this patch set.\n\nAuthored-By: Petr Malik <pmalik@tesora.com>\nChange-Id: I0fe96301087e3bd49d937c7c489006fd9d84ca1e\nDepends-On: Ib969a111d102b817c9f18437c1f36bd17e3a8a4b\nCloses-Bug: 1431618\nRelated-Bug: 1438430","distinct":true,"url":"https://api.github.com/repos/openstack/trove/commits/0397f9c6a00c200572a55ba95d8a92a7a9596168"}]}