Things to try.

1. Does the path exist?

I know it sounds silly but make sure that the directory /apachelogs/data exists. Also make sure that the file exists, /apachelogs/data/file and that you have permissions to manipulate it.

2. Try the commands from a shell

I would confirm that the above commands can work in a shell directly before attempting to do them from Python.

Example

Try the following:

$ cd /apachelogs/data
$ touch foobar


Now add the extended attribute:

$ setfattr -n user.foo -v bar foobar
$ getfattr -d foobar
# file: foobar
user.foo="bar"


References


setfattr always returns "Operation Not Supported"


Setfattr always returns operation not supported
this class and I need to turn up the code coverage of 78 to 100

The class

public class AlsurOrderAssignment {

    public CPA_Order_Allocation__c allocation { get; set; }
    public List&lt;CPA_Order_Allocation__c&gt; currentAllocations { get; set; }
    public String association { get; set; }
    public String order {get; set;}
    public CPA_Order__c orderObject { get; set; }
    public Map&lt;Id, CPA_Order__c&gt; orderObjects { get; set; }

    public AlsurOrderAssignment() {
        allocation = new CPA_Order_Allocation__c(Number_of_Units_of_Presentation__c=0.00);
        orderObjects = new Map&lt;Id, CPA_Order__c&gt;();
    }
    public void findOrder() {
        System.debug(orderObjects.size());
        orderObject = orderObjects.get(order);System.debug('we got here');
        currentAllocations = [Select Id,
                                    Association__c,
                                    Association__r.Name,
                                    Number_of_Units_of_Presentation__c,
                                    Number_of_Kilos__c,
                                    Number_of_Baskets__c
                                From
                                    CPA_Order_Allocation__c
                                where
                                    CPA_Order__c=:order];
    }

    public List&lt;SelectOption&gt; getOrderItems() {

        List&lt;CPA_Order__c&gt; orders = [Select Id,
                                            Client__c,
                                            Product_Name__c,
                                            Unallocated_Units_of_Presentation__c,
                                            Unallocated_Number_of_Kilos__c,
                                            Unallocated_Number_of_Baskets__c,
                                            Client_Product_Association__c,
                                            Order_Code__c,
                                            Expected_Delivery_Date__c,
                                            Unit_of_Presentation__c,
                                            Presentacion__c
                                        from 
                                            CPA_Order__c
                                        where
                                            Expected_Delivery_Date__c = LAST_N_DAYS:5
                                        and 
                                            Unallocated_Units_of_Presentation__c &gt; 0];

        orderObjects.putAll(orders);
        System.debug(orderObjects.size());
        List&lt;SelectOption&gt; options = new List&lt;SelectOption&gt;();
        for (CPA_Order__c order : orders) {
            options.add(new SelectOption(order.Id, order.Order_Code__c));
        }
        return options;
    }

    public PageReference saveAllocation() {
        allocation.CPA_Order__c = order;
        allocation.Association__c = association;
        insert allocation;
        PageReference currentPage = ApexPages.currentPage();
        currentPage.setRedirect(true);
        return currentPage;
    }
    public List&lt;SelectOption&gt; getAssociationItems() {
        list&lt;Association__c&gt; associations = [Select Id, Name from Association__c];
        List&lt;SelectOption&gt; options = new List&lt;SelectOption&gt;();
        for (Association__c association : associations) {
            options.add(new SelectOption(association.Id, association.Name));
        }
        return options;
    }
}


The Test Class

@isTest 
private class testAlsurOrderAssignment{
    @isTest
    static void validateAlsurOrderAssignment(){
        // 1. Set things up
        Association__c association = new Association__c();
        association.Name = 'Alsurtest';
        insert association;

        Contact contact = new Contact();
        contact.FirstName = 'pedrito';
        contact.LastName = 'perez';
        insert contact;

        CPA_Order__c order = new CPA_Order__c();
        order.Number_of_Units_of_Presentation__c = 10;
        order.Contact__c = contact.Id;
        order.Expected_Delivery_Date__c = System.today();
        order.Unit_of_Presentation__c = '5';
        insert order;

        CPA_Order_Allocation__c allocation = new CPA_Order_Allocation__c();
        allocation.CPA_Order__c = order.Id;
        allocation.Association__c = association.Id;
        allocation.Number_of_Units_of_Presentation__c = 5;
        allocation.Number_of_Kilos__c = 5;
        insert allocation;

        CPA_Order_Allocation__c[] allocations = [SELECT Id, CPA_Order__c from CPA_Order_Allocation__c where CPA_Order__c =: order.Id];
        System.assertEquals(allocations.size(), 1);

        // 2. Run the code you want to test
        // Run findOrder() method
        AlsurOrderAssignment assignmentClass = new AlsurOrderAssignment();

        assignmentClass.getOrderItems();
        System.assert(assignmentClass.orderObjects.size() &gt; 0);    

        List&lt;SelectOption&gt; options = assignmentClass.getAssociationItems();
        System.assert(options != null);

        assignmentClass.findOrder();
        System.assert(assignmentClass.orderObjects.size() &gt; 0);
    }
}


TKS
