Python os.makedir() Examples

The following are code examples for showing how to use os.makedir(). They are extracted from open source Python projects. You can vote up the examples you like or vote down the ones you don't like. You can also save this page to your account.

Example 1
Project: charm-swift-proxy   Author: openstack   File: config.py    (Apache License 2.0) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 2
Project: charm-swift-proxy   Author: openstack   File: config.py    (Apache License 2.0) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 3
Project: charm-heat   Author: openstack   File: config.py    (Apache License 2.0) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 4
Project: charm-heat   Author: openstack   File: config.py    (Apache License 2.0) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 5
Project: charm-keystone   Author: openstack   File: config.py    (Apache License 2.0) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 6
Project: charm-keystone   Author: openstack   File: config.py    (Apache License 2.0) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 7
Project: charm-keystone   Author: openstack   File: config.py    (Apache License 2.0) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 8
Project: charm-keystone   Author: openstack   File: config.py    (Apache License 2.0) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 9
Project: charm-keystone   Author: openstack   File: config.py    (Apache License 2.0) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 10
Project: charm-keystone   Author: openstack   File: config.py    (Apache License 2.0) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 11
Project: charm-keystone   Author: openstack   File: config.py    (Apache License 2.0) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 12
Project: charm-nova-cloud-controller   Author: openstack   File: config.py    (Apache License 2.0) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 13
Project: charm-nova-cloud-controller   Author: openstack   File: config.py    (Apache License 2.0) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 14
Project: charm-nova-compute   Author: openstack   File: config.py    (license) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 15
Project: charm-nova-compute   Author: openstack   File: config.py    (license) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 16
Project: charm-ceph-osd   Author: openstack   File: config.py    (license) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 17
Project: charm-ceph-osd   Author: openstack   File: config.py    (license) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 18
Project: charm-glance   Author: openstack   File: config.py    (license) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 19
Project: charm-glance   Author: openstack   File: config.py    (license) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 20
Project: charm-glance   Author: openstack   File: config.py    (license) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 21
Project: charm-glance   Author: openstack   File: config.py    (license) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 22
Project: charm-glance   Author: openstack   File: config.py    (license) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 23
Project: charm-glance   Author: openstack   File: config.py    (license) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 24
Project: charm-glance   Author: openstack   File: config.py    (license) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 25
Project: charm-neutron-api   Author: openstack   File: config.py    (license) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 26
Project: charm-neutron-api   Author: openstack   File: config.py    (license) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 27
Project: charm-ceph-mon   Author: openstack   File: config.py    (license) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 28
Project: charm-ceph-mon   Author: openstack   File: config.py    (license) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 29
Project: charm-openstack-dashboard   Author: openstack   File: config.py    (license) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 30
Project: charm-openstack-dashboard   Author: openstack   File: config.py    (license) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 31
Project: charm-ceilometer   Author: openstack   File: config.py    (license) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 32
Project: charm-ceilometer   Author: openstack   File: config.py    (license) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 33
Project: charm-ceilometer   Author: openstack   File: config.py    (license) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 34
Project: charm-ceilometer   Author: openstack   File: config.py    (license) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 35
Project: charm-ceilometer   Author: openstack   File: config.py    (license) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 36
Project: charm-ceph   Author: openstack   File: config.py    (license) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 37
Project: charm-ceph   Author: openstack   File: config.py    (license) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 38
Project: Basic-discord-bot   Author: TheWizoid   File: points_stuff.py    (license) View Source Project 5 votes vote down vote up
def add_points(message):
    """
    Every time someone sends a message, they gain one point.
    This is because any time based ones would result in mobile users having
    the same amount of each, due to idling.
    """

    split_message = message.content.split()

    message.author.name = message.author.name.lower()
    points = load_points(message, message.author.name)
    message_amount = messages.load_messages(message, message.author.name)

    non_trigger = ["!points","!roulette","!userpoints","!givepoints","!barryroulette","!rps","!rockpaperscissors"]
    non_message_trigger = ["!usermessages","!messages"]
    if message.author.name not in message_amount:
        message_amount[message.author.name] = 0
    elif len(split_message) == 0 or split_message[0] not in non_message_trigger:
        message_amount[message.author.name] += 1

    if message.author.name not in points:
        points[message.author.name] = 0
    elif len(split_message) == 0 or split_message[0] not in non_trigger:
        points[message.author.name] += 1

    try:
        pickle.dump(points, open("{0}/{0}_points.txt".format(str(message.server)),"wb"))
    except FileNotFoundError:
        try:
            os.makedir("{}".format(message.server))
        except FileExistsError:
            temp_points = open("{0}/{0}_points.txt".format(str(message.server)),"w")
            temp_points.close()
        pickle.dump(points, open("{0}/{0}_points.txt".format(str(message.server)),"wb"))
    pickle.dump(message_amount, open("{0}/{0}_messages.txt".format(str(message.server)),"wb"))
    return True

#Sets emotes in points, is its own function due to me using it twice. 
Example 39
Project: charm-ceph-radosgw   Author: openstack   File: config.py    (license) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 40
Project: charm-ceph-radosgw   Author: openstack   File: config.py    (license) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 41
Project: charm-swift-storage   Author: openstack   File: config.py    (license) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 42
Project: charm-swift-storage   Author: openstack   File: config.py    (license) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 43
Project: charm-swift-storage   Author: openstack   File: config.py    (license) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 44
Project: charm-swift-storage   Author: openstack   File: config.py    (license) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 45
Project: charm-swift-storage   Author: openstack   File: config.py    (license) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 46
Project: charm-swift-storage   Author: openstack   File: config.py    (license) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 47
Project: charm-swift-storage   Author: openstack   File: config.py    (license) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 48
Project: equlipse   Author: konono   File: config.py    (license) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 49
Project: equlipse   Author: konono   File: config.py    (license) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0) 
Example 50
Project: equlipse   Author: konono   File: config.py    (license) View Source Project 5 votes vote down vote up
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)